Anti_vowel help please


Oops, try again. Your function fails on anti_vowel("Hey look Words!"). It returns "Hey look Words!" when it should return "Hy lk Wrds!".

I actually expected this to pass through, Am I on the right track or completely off? thanks for your time :slight_smile:

def anti_vowel(text):
    vowels = ["a", "e", "i", "o", "u", "A", "E", "I", "O", "U"]
    for x in text:
        for lol in vowels:
            if x == lol:
                x = ""
    return text


x is the iterator, it gets re-assigned each iteration of the loop and change made it to it, won't persist.


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