anti_Vowel


#1


anti_vowel


Oops, try again. Your function fails on anti_vowel("Yab Gab to Trab Yab Yab Aeiouz"). It returns "Yb Gb t Trb Yb Yb Az" when it should return "Yb Gb t Trb Yb Yb z".


Replace all vowels for blanks


def anti_vowel(text):
    vowels = ('a', 'e', 'i', 'o', 'u')
    for x in text.lower():
        if x in vowels:
            text = text.replace(x, "")        
    return text


#2

for some odd reason this fixed it:

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

#3

Lists are enclosed in square brackets.

vowels = ('a', 'e', 'i', 'o', 'u')

should be

vowels = ['a', 'e', 'i', 'o', 'u']

#4

This error doesn't make much sense to me. Everything is caught except the lower case e even though it is in the check


#5

I just ran into the same issue. The issue is in your if loop. new_word is being replaced with text every time there is a vowel. This means only one vowel will be removed.


#6

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