8. anti_vowel help!


#1




I'm getting the error:
Your function fails on anti_vowel("Hey look Words!"). It returns "" when it should return "Hy lk Wrds!".


I understand that my else statement is returning the initial value of 'I', but I'm frustrated and don't know what to use instead. I remember having a similar problem in the past but that was solve by using a 'for-else' instead of an 'if-else', but that doen't work here. It's killing me.


def anti_vowel(text):
    for i in text:
        if i in "aeiouAEIOU":
            return '' 
        else:    
            return i,

Preformatted text


#2

return is not something you want to be doing inside a loop that is accumulating a result. We need the loop to run its full course.


#3

So I need to store the result of 'i' each time, like in a list??


#4

A list would work well. It can be joined in the return statement.


#7