[Tutor] code won't work now

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Wed, 28 Feb 2001 21:10:58 -0800 (PST)


On Wed, 28 Feb 2001, Katharine Stoner wrote:

> day = input("On a scale of 1 to 10, how was your day?")
> if day == (fine):
> #used double equals to make 
>     fine = "The salad is properly cooked."
>     print fine
> else:
>     print "Cook the salad some more."
> 
> 
> What is wrong with this?  I had it working and then saved it and now
> it doesn't work in the GUI.  Help please.

The only line that signals a warning for me is this one:

> if day == (fine):

You probably meant to write:

###
if day == "fine":
###

instead; you'll want to compare your day to the string "fine".  Without
the quotes, Python will unsuccessfully try to look for a variable named
'fine', throw up its hands, and give a NameError.

Hope this helps!