• extract interger from string

Question related to mission Sum Numbers

 
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?