get a number in a string python code example
Example: how to get a number from a string in python
string = "I am 14 years old"
for i in string.split():
if i.isdigit():
print(i)
print()
string = "I am 14 years old"
for i in string.split():
if i.isdigit():
print(i)
print()