My code throws the error message "Oops, try again. Your function fails on anti_vowel("Hey look Words!"). It returns "" when it should return "Hy lk Wrds!"."
I'm expecting the code to go over the entire text and replace the vowels with an empty string, which should theoretically give the correct output for whatever is put into it.
Here's my code:
def anti_vowel(text): vowels = "AEIOUaeiou" result = "" for char in text: if char in vowels: text.replace(char, "") return result
I think I'm just using the str.replace() function wrong.