forked from Techsrijan/mpsummer25
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheven_odd_between.py
More file actions
32 lines (32 loc) · 855 Bytes
/
even_odd_between.py
File metadata and controls
32 lines (32 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from gtts import gTTS
from playsound import playsound
start=int(input("enter start number"))
last=int(input("enter end number"))
if start<last:
i=start
while i<=last:
if i % 2 == 0:
print("even no=", i)
a = gTTS('Even No')
a.save('audio1.mp3')
playsound('audio1.mp3')
else:
print("Odd no=", i)
a = gTTS('Odd1 No')
a.save('audio2.mp3')
playsound('audio2.mp3')
i=i+1
else:
i = start
while i >= last:
if i % 2 == 0:
print("even no=", i)
a = gTTS('Even No')
a.save('audio1.mp3')
playsound('audio1.mp3')
else:
print("Odd no=", i)
a = gTTS('Odd1 No')
a.save('audio2.mp3')
playsound('audio2.mp3')
i = i - 1