Anti_vowel stops at vowels instead of removing them


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

The vowels are stopping the function for some reason.

def anti_vowel(text):
    for letter in text:
        if letter == 'a' or letter == 'e' or letter == 'i' or letter == 'o' or letter == 'u':
            return ''
            return letter


a function ends the moment a return keyword is reached

so your function ends in the first iteration of the loop, you will need to rethink your approach

maybe you can make a list/string to append the consonants to? This will give you an anti vowel string


Thanks, I made a list and used .join on it. Now it works just fine! :grinning: