How to convert an integer to a string in Python
To convert an integer to a string, we can use the built-in str()
function in Python.
Here is an example that converts integer 21
to a string.
num = 21
print(str(num))
Output:
'21'
To convert an integer to a string, we can use the built-in str()
function in Python.
Here is an example that converts integer 21
to a string.
num = 21
print(str(num))
Output:
'21'