Anti_vowel


#1



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


What is wrong?


def anti_vowel(text):
    no_vowel=''
    for character in text:
        if character!='a' or character!='A' or character!='e' or character!='E' or character!='i'or character!='I' or character!='o' or character!='O' or character!='u' or character!='U':
            no_vowel+=character
    return no_vowel


#2

if charachter is a vowel we get, for example a we get:

false or true or true or true # and so on

false or true is true, so it still adds the vowel to no_vowel, if you want to do this, you will have to use the and operator


#3

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