If a string contains only numerical characters, you can convert it into an integer using the int() function.
>>> int('227')
227
Let’s check the types:
>>> type('227')
<class ‘str’>
>>> type(int('227'))
<class ‘int’>
>>> int('227')
227
Let’s check the types:
>>> type('227')
<class ‘str’>
>>> type(int('227'))
<class ‘int’>