Vowel check keeps crashing

I don’t know why, but when running the anti_vowel exercise (https://www.codecademy.com/courses/learn-python/lessons/practice-makes-perfect/exercises/antivowel) whenever I run my code, it crashes. why? (Python 2)

def anti_vowel(text):
for letter in text:
blank = “”
if letter in “aeiouAEIOU”:
print blank
else:
print letter

anti_vowel(“Hey You!”)

1 Like

Are you typing print(blank) and print(letter) with parenthesis around the variables?

No I am not, should I be?

1 Like

That’s my bad. Python 2 should allow absence of parenthesis. This is an infinite loop issue.

But upon inspecting further, it’s actually infinite recursion. Your function invocation is indented as if it’s within the function. That means when you function ends, it calls itself again!

Unindent your invocation of the function and this should work just fine :slight_smile:
But you’re still not doing what the instruction says. (Consider that the function needs to have a return value).

2 Likes

thank you so much! :grinning:

1 Like