Convert string to int Python

In this Python string tutorial, you will learn how to convert string to int in Python.

# Create a string
S = "467839"

# Convert string into integer
I = int(S)

# Print integer
print(I)

# Display the type of I
print(type(I))

Output:

467839
<class 'int'>

Free learning resources: AiHintsCodeAllow

Leave a Comment

Your email address will not be published.