Anti_vowel


#1



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


Replace this line with your code. 
def anti_vowel(text):
    x=[]
    for char in text:
        x.append(char)
    for c in x:
        if c in "aeiouAEIOU":  
            x.remove(c)
    result=""
    for t in x:
        result+=t
    return result    
    
what's wrong with my code??


#2

anybody???help.......................


#4

what can i do???do you know??


#6

thanks for your help!!!


#9

so this specific code has this problem which cant be solved... right??


#11

you know what... now i really understand what you were talking about... I appreciate your help!!!!!!!


#13

Instead of adding all letters from text and then remove the vowels, why not add only the consonants to x? that would be simpler to write.


#14

you are a genius!!!!!!!!!!! thank you
def anti_vowel(text):
x=[]
for char in text:
x.append(char)
z=[]
for c in x:
if c not in "aeiouAEIOU":
z.append(c)
result=""
for t in z:
result+=t
return result


#15

happy to help :slight_smile:


#18

def anti_vowel(text):
no_vowels = []
for c in text:
if c not in "aeiouAEIOU":
no_vowels += c
return ''.join(no_vowels)

print anti_vowel("Hey You! aeiou vbvb AEIOU")


#19

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