Anti-vowel problem

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):
    for x in text:
        text = text.replace("x","")
    return text

print anti_vowel("hello")


Two mistakes..

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


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


It can be done without conditional , as I mentioned.


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


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