0

Is there any method or package to convert number to strings?

67- sixty seven 99- ninety nine

14th Sep 2020, 12:33 PM
Jeevan Manjunath Naik
Jeevan Manjunath Naik - avatar
1 Odpowiedź
+ 1
num2words sounds like something you want. The following works in Sololearn's code playground. Sololearn uses an old version of pip which causes a warning but that's an unrelated issue: def install(m): import os os.system("pip install -q "+m) install("num2words") from num2words import num2words print(num2words(67)) print(num2words(99)) More detail on num2words is at: https://pypi.org/project/num2words/ That says to install using "tox" but Sololearn's pip couldn't find that. It found 'num2words' like above, though.
15th Sep 2020, 4:13 AM
Josh Greig
Josh Greig - avatar