0

Can python convert number to string data type ? ex: i input "35" => result: thirty five

number = 35
print("number with string type: ")
arnaud
  • 3,293
  • 1
  • 10
  • 27

2 Answers2

2

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))
Gokul nath
  • 494
  • 2
  • 8
  • 17
-1

you can use num2words for this task like this.

from num2words import num2words

result = num2words(35)

thirty five