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):
    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':
    return no_vowel


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


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