I'm having trouble getting the code to run through the whole text string..
it says: Your function fails on anti_vowel("Hey look Words!"). It returns "H" when it should return "Hy lk Wrds!".

I'm wondering why it won't run through all n? I was going to do a while loop but when I was looking at other people's issues I could see that using a for loop was much cleaner and simpler... but mine either stops after H or stops after He, but it doesn't go all the way???

def anti_vowel(text):
    x = []
    for n in txt:
        if n not in 'aeiouAEIOU':
        return ''.join(x)


The return statement is inside the loop block so returning before the text is completely iterated.


oh, duh! thank you!!


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