Answers for "python3 string to int"

1

python get int from string

>>> import re
>>> string1 = "498results should get"
>>> int(re.search(r'd+', string1).group())
498
Posted by: Guest on April-07-2020
0

how to turn a string into an int python

#The string
number_string = input('Type a number')
result = int(number_string) + 2
print(int(result))
Posted by: Guest on October-30-2021
0

how to turn a string into an integer python

a_string = "1234"
a_int = int(a_string)
Posted by: Guest on September-19-2020

Python Answers by Framework

Browse Popular Code Answers by Language