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

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


This line:

            newtext = text.replace(i, "")

should be

            text = text.replace(i, "")

Also, you don't need that print statement.


ok works now.


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