Anti_vowel help please


#1



https://www.codecademy.com/courses/python-intermediate-en-rCQKw/1/2?curriculum_id=4f89dab3d788890003000096#


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


#3

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


#4

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