Please find the error


#1

def anti_vowel(text):
    no_vowels=""
    for n in text:
        if n in "aeiouAEIUO":
            break
        else:
            no_vowels+=n
        return no_vowels

#2

break breaks the loop, so the moment a vowel is found, the loop breaks, that can't be right

a function ends the moment a return keyword is reached, the function ends. So, your function ends in the first iteration/run of the loop, but to get the anti vowel string the whole loop needs to run so place return outside the loop


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.