Anti_vowel


#1



Whats wrong with my code??i have tried many times.but couldn't find ..i hope someone will help


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


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


def anti_vowel(text):
    for i in text:
        if i in "aeiouAEIOU":
            newtext = text.replace(i, "")
            print newtext
    return newtext


#2

This line:

            newtext = text.replace(i, "")

should be

            text = text.replace(i, "")

Also, you don't need that print statement.


#3

ok thanks..it works now.


#4

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