[Tutor] if statement

Alan Gauld alan.gauld at btinternet.com
Tue Nov 2 21:08:34 CET 2010

"Glen Clark" <glenuk at gmail.com> wrote

> confirmed = int(input("Are you happy with this? (y/n): ")
> if confirmed == "y":

count the parens.

It thinks you are trying to do:

confimed = int(input('ffff') if foo else bar)


Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list