Light Mode
Dark Mode
extract interger from string
text = "hello 10 and 1" 

for word in text.split():
    if word.isdigit():
        return sum(int(word)    
    else:
        return 0

Why will this code not work correctly?

Created: March 5, 2023, 3:52 p.m.
Updated: March 5, 2023, 4:22 p.m.
0
5
User avatar
Timmy94