In this tutorial, we are going to learn how to convert the string to an integer in Python.
To convert a string to an integer, we can use the built-in
int() function in Python.
Here is an example, that converts the string
21 to an integer:
a = '21' print(int(a)) # prints number 21