The following is my code:

def anti_vowel(text):
  result = ' '
  for n in text:
    if n not in "aeiouAEIOU":
      result += n
  return result

And for some reason i am getting the following error:

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

Please help me! :grinning::grin:


you have a leading space in your anti result string because result is not an empty string when declared, this causes the error


I didn’t quiet get you. Can you tell me more about it please.


Its throwing the following error:

Did you create a function called anti_vowel? Your code threw a "global name 'aeiouAEIOU' is not defined" error.


when declaring result:

result = ' '

the string should be empty, currently it contains a space


Thanks a lot! I finally got it!!!:grin: