Anti_vowel


#1


https://www.codecademy.com/en/courses/python-intermediate-en-rCQKw/1/2?curriculum_id=4f89dab3d788890003000096#

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"))


#2

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


#3

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.


#4

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