Anti_vowel


#1



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


Error: Your function fails on anti_vowel("Hey look Words!"). It returns "None" when it should return "Hy lk Wrds!".


It printed the correct phrase but why does it print "None"?


def anti_vowel(text):
    vowel = ['a', 'e', 'i', 'o', 'u']    
    result = []    
    for i in list(text):
        if i.lower() not in vowel:
            result.append(i)
    print "".join(result)


#2

you need to return the string without vowels.

then, add print + function to print the string


#3

Thanks I found out I just needed to change "print" into "return"


#4

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