forked from fenyx-it-academy/Class4-PythonModule-Week3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreading_number
More file actions
23 lines (18 loc) · 775 Bytes
/
reading_number
File metadata and controls
23 lines (18 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 2.reading_number 28---------------->Twenty Eight
tens=["twenty","thirty","fourty","fifty","sixty","seventy","eighty","ninety"]
ones=["one","two","three","four","five","six","seven","eight","nine"]
teen=["ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"]
def number_written():
a=int(input("Enter a two digit number "))
a1=a%10
a2=a//10
if 9<a<20:
print("{}---------------->{}".format(a,teen[a1]))
elif 19<a<100:
if a1==0:
print("{}---------------->{}".format(a,tens[a2-2]))
else:
print("{}---------------->{}".format(a,tens[a2-2]+" "+ones[a1-1]))
else:
print("Please enter a correct number!")
number_written()