Anti-vowel problem


#1



https://www.codecademy.com/courses/python-intermediate-en-rCQKw/1/2?curriculum_id=4f89dab3d788890003000096#
Below is my code, i couldnt figure out why the x in the for loop cannot become a local variable.

i expect the x variable would be replaced with the elements in the vow, i.e., aeiouAEIOU
Yet i dont think this works.

Replace this line with your code. 
def anti_vowel(text):
    vow=["a","e","i","o","u","A","E","I","O","U"]
    for x in text:
        text = text.replace("x","")
    return text

print anti_vowel("hello")


#2

Two mistakes..

1.You're not using your list vow
2.While iterating you're replacing x as "x" (it's already a string.)


#3

You need conditional statement insideYour for loop that checks if your character "x" is in your VOW list


#4

It can be done without conditional , as I mentioned.


#5

thanks a lot! i have it edited already and it is good.


#6

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