Answers for "python change variable type"

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

change variable type python

x = 12
str(x) #it's a String now 

number = "24"
int(number) #it's an integer now
Posted by: Guest on March-14-2021

Code answers related to "python change variable type"

Python Answers by Framework

Browse Popular Code Answers by Language