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

This is the output:

Ths shld wrk

Why do I get the error message?

def anti_vowel(text):
    vowels = "aeiouyAEIOUY"
    new_word = ""
    for i in text:
        if i not in vowels:
           new_word = new_word + i
    return new_word    
print(anti_vowel("This should work"))


Your vowel list should not contain a y. Read the instructions carefully.


You know originally I did not have it. I thought I read the opposite to include the y. Pay attention to detail!!! sorry. Thanks for the help.


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