We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e84ebad commit fb34e4cCopy full SHA for fb34e4c
02_type.py
@@ -0,0 +1,5 @@
1
+a = "1221212"
2
+b = int(a)
3
+t = type(b)
4
+
5
+print(t)
03_input.py
@@ -0,0 +1,10 @@
+a = int(input("Enter Number 1"))
+b = int(input("Enter Number 2"))
+print("Number a is:", a)
6
+print("Number b is:", b)
7
8
9
10
+print("Sum is ",a+b)
Problem1.py
@@ -0,0 +1,27 @@
+print('''
+Twinkle, twinkle, little star,
+How I wonder what you are!
+Up above the world so high,
+Like a diamond in the sky.
+When the blazing sun is gone,
+When he nothing shines upon,
+Then you show your little light,
+Twinkle, twinkle, all the night.
11
12
+Then the traveler in the dark
13
+Thanks you for your tiny spark;
14
+He could not see which way to go,
15
+If you did not twinkle so.
16
17
+In the dark blue sky you keep,
18
+And often through my curtains peep,
19
+For you never shut your eye,
20
+Till the sun is in the sky.
21
22
+As your bright and tiny spark
23
+Lights the traveler in the dark—
24
+Though I know not what you are,
25
+Twinkle, twinkle, little star.
26
+ '''
27
+ )
problem1.py
@@ -0,0 +1,4 @@
+a =1
+b=3
+print(a+b)
problem2.py
@@ -0,0 +1,28 @@
+import pyttsx3
+engine = pyttsx3.init() # object creation
+""" RATE"""
+rate = engine.getProperty('rate') # getting details of current speaking rate
+print (rate) #printing current voice rate
+engine.setProperty('rate', 125) # setting up new voice rate
+"""VOLUME"""
+volume = engine.getProperty('volume') #getting to know current volume level (min=0 and max=1)
+print (volume) #printing current volume level
+engine.setProperty('volume',1.0) # setting up volume level between 0 and 1
+"""VOICE"""
+voices = engine.getProperty('voices') #getting details of current voice
+#engine.setProperty('voice', voices[0].id) #changing index, changes voices. o for male
+engine.setProperty('voice', voices[1].id) #changing index, changes voices. 1 for female
+engine.say("Hello World!")
+engine.say('My current speaking rate is ' + str(rate))
+engine.runAndWait()
+engine.stop()
+"""Saving Voice to a file"""
+# On linux make sure that 'espeak' and 'ffmpeg' are installed
+engine.save_to_file('Hello World', 'test.mp3')
28
variable.py
+a = 1
+b = 2
+print(a + b)
+c = True & True
+print(c)
0 commit comments