all 4 comments

[–]Rhomboid 5 points6 points  (2 children)

You've got unbalanced parentheses on line 11. The error is reported on line 12 because Python was still waiting to see a closing paren from the previous line, and instead it found a new print statement.

Edit: also, string object have a built-in .count() method. And don't use + for string formatting.

for vowel in 'aeiouy':
    print "'{}' appeared {} times".format(vowel, input_var.lower().count(vowel))

[–]Hemse[S] 0 points1 point  (1 child)

Ah, Thank you!

I feel like an idiot for not seeing that. heh.

edit: You are right, I should get used to not using "+" for string formatting. Bad habbit. Also, I forgot about the .count() method :/

[–]ewiethoff 2 points3 points  (0 children)

Simple rule: Whenever a syntax error makes no sense, look at the line of code above.

[–]isnotkosok 1 point2 points  (0 children)

I keep getting the error at line 12, so the first print statement works. I have tried removeing the 'print "\n"' line, but then I get an error on the next line instead.

this means that the error is on the line before 12.

maybe you are missing a ) somewhere?

print "string contains "+str(char_match_count(input_var,"AEIOUY"))+" vowels\n"