Anti_vowel


#1

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:


#2

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


#4

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


#5

Its throwing the following error:

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


#6

when declaring result:

result = ' '

the string should be empty, currently it contains a space


#7

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


#8