Can python convert number to string data type ? ex: i input "35" => result: thirty five
number = 35
print("number with string type: ")
Can python convert number to string data type ? ex: i input "35" => result: thirty five
number = 35
print("number with string type: ")
This can be done with inflect
. You can install inflect
through pip. Try pip install inflect
in CMD or install through your IDE.
Try below code,
import inflect
print(inflect.engine().number_to_words(35))
you can use num2words for this task like this.
from num2words import num2words
result = num2words(35)
thirty five