Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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()
 
PREVIOUS NEXT
Tagged: #number #string #python
ADD COMMENT
Topic
Name
1+3 =