Anti-vowel functions


#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 "None" when it should return "Hy lk Wrds!"."

Although, when I do try calling this phrase on my function (written with the help of the small hint, in one of the easiest ways I could think of...), it prints:

"Hy lk Wrds!"
None

to the console.

def anti_vowel(text):
    lst = []
    for l in text:
        if l not in "aeiouAEIOU":
            lst.append(l)
    print "".join(lst)

What went wrong in this program? :eyes:


#2

your function only prints the anti vowel string, it doesn't return the anti vowel string


#3

Ah. Thank you! Good to hear that's the only problem with it.


#4

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