by @saigowthamr

How to convert an integer to a string in Python

Home » python » 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'