Converting integer to string in Python

>>> str(10)
'10'

>>> int('10')
10

Links to the documentation:

Conversion to a string is done with the builtin str() function, which basically calls the __str__() method of its argument.

Leave a Comment