Oops, try again. Your function fails on anti_vowel("Hey look Words!"). It returns "Hy lok Wrds!" when it should return "Hy lk Wrds!".
Hello, here is my code for the anti_vowel function. I don't understand why it returns "Hy lok Wrds!" when it should return "Hy lk Wrds!" and moreover with look having two o's the code should work normally. I would like someone to explain me why this happens and also debug my code.
def anti_vowel(text): mylist = list(str(text)) i =0 while i < len(mylist): for c in "aeiouAEIOU": if mylist[i] == c: mylist.pop(i) i += 1 total = ''.join(mylist) return total