How to convert string to int in Python
String and int are two different datatypes used in python. Conversion from one datatype to another is possible in python.
A String datatype can be converted into int using the built-in python function int(). The int() function takes any python data type and convert it into int datatype. This is applicable for string also. Isn’t that simple!
input='54' output=int(input) print("output is "+output)
Output
output is 54
Subscribe
Login
Please login to comment
0 Discussion