Untitled

 avatar
user_1004214
python
a year ago
457 B
6
Indexable
pip install num2words

from num2words import num2words

print(num2words(10001))  # cardinal is default

# Output ou saida ===> ten thousand and one

print(num2words(20.22, to='currency'))
# Output===> twenty euro, twenty cents

print(num2words(2022, to='year'))

# output ===> twenty twenty-two

print(num2words(3, to='ordinal'))

# output===> third (terceiro)

print(num2words(3, to='ordinal_num'))
##output ==> 3rd = terceiro abreviado
Editor is loading...
Leave a Comment