-
Notifications
You must be signed in to change notification settings - Fork 1
/
Number_to_words project.py
34 lines (24 loc) · 1.13 KB
/
Number_to_words project.py
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
33
34
# - Number to words . Create a python function that takes an integer number and
# print the number in words
from num2words import num2words
def num_words():
'''Create a python function that takes an integer number and
print the number in words'''
num = int(input("enter number : "))
return f"{num2words(num,lang='ar')}\n{num2words(num,lang='en')}"
# inpute number and return words in arabic langushe
words = num_words()
print(words)
# enter number : 13875
# ثلاثة عشر ألفاً و ثمانمائةخمسة و سبعون
# thirteen thousand, eight hundred and seventy-five
# enter number : 1987
# one thousand, nine hundred and eighty-seven
# enter number : 2020
# two thousand and twenty
# Help on function num_words in module __main__:
# num_words()
# Create a python function that takes an integer number and
# # print the number in words
# واحد مليار و ثمانية و ثمانون مليوناً و سبعمائةسبعة و ثمانون ألفاً و مئتان و خمسة و أربعون
# one billion, eighty-eight million, seven hundred and eighty-seven thousand, two hundred and forty-five