Convert integer to string in Python

>>> str(42)
'42'

>>> int('42')
42

Links to the documentation:

str(x) converts any object x to a string by calling x.__str__().

Leave a Comment