I am getting VERY weird results for exercise 8



Instead of the correct output, I get "bcdHy lk Wrds!" (copied directly from the pop up error box). It works when I use the print command and for other inputs, but not "Hey look Words!" I'm honestly at my wits end, and I have no idea what to do next. I even got rid of all 'b's and 'c's in the entire code in case they are somehow screwing me up. I'm that completely out of ideas.

Thanks for your help!

v = 'aeiou'
a = []
s = ''
def anti_vowel(text):
    for n in text:
        if n in v:
    return s.join(a)


Why is your function storing data outside of itself? Is it at all desirable to store data between function calls? Shouldn't it start over completely each time it is called?


the errors are due to the variable declarations outside the function


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