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

why the "o" in "Words" is not remove?? if I add anythings like "Hey look loo Words!" then it turn out like "Hey lk lo Words!" someone please help, thanks!

Replace this line with your code. 
def anti_vowel(text):
    input_text = []
    for x in text:

    for y in input_text:
        if y == "a" or y == "A" or y == "o" or y == "O" or y == "e" or y == "E" or y == "u" or y == "U" or y == "i" or y == "I":
            z = input_text.index(y)
            print input_text

    string_test = ""
    for k in input_text:
        string_test = string_test + k

    return string_test

print anti_vowel("Hey look Words")


Changing a list you're currently looping through is going to affect the loop, something you haven't accounted for.
Rather than trying to solve that problem, avoid it - don't loop through and change the same list


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