Anti_vowel - removing whole thing?


My code gives the error: Your function fails on anti_vowel("Hey look Words!"). It returns " ey look Words!" when it should return "Hy lk Wrds!".
I have no idea how it removed the "H", that was not in my code at all.
I realise there is something wrong with my if statement, but i can't work out what, please help me realise my mistake.
Thanks in advance :relaxed:

def anti_vowel(text):
    for letter in text:
        if letter == "a" or "A" or "e" or"E" or "i" or "I" or "o" or           "O" or "u" or "U":
            text = text.replace(letter, " ")
            return text
            return text


You are somewhat overthinking this. Try following this template:

        if INDIVIDUAL_ITEM in "aeiouAEIOU":
            text = text.replace(INDIVIDUAL_ITEM, "")
    return PARAMETER

If you have any questions on how or why this works, please, just ask.


Thank you that worked :relaxed:


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