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

Anyone know what im doing wrong?

def anti_vowel(text):
    lst = ['A','E','I','O','U','a','e','i','o','u']
    txt = list(text)
    for n in lst:
        for i in txt:
            if n == i:
    return ''.join(txt)


Removing elements from a list that you're currently looping through affects what elements the loop visits - which you can verify by printing out the current character from within the loop


ah thanks, managed to figure it out


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