Categories
Python Answers

How to convert an integer to string in Python?

Spread the love

Sometimes, we want to convert an integer to string in Python.

In this article, we’ll look at how to convert an integer to string in Python.

How to convert an integer to string in Python?

To convert an integer to string in Python, we can use the str function.

For instance, we write:

num =  str(10)
print(num)

We call str with the number we want to convert to a string.

And the string version of the number is returned.

Then num is '10'.

Conclusion

To convert an integer to string in Python, we can use the str function.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *