[Tutor] Unknown reason for error.

greg whittier greg at thewhittiers.com
Thu Sep 24 22:59:17 CEST 2009


On Thu, Sep 24, 2009 at 2:15 PM, Corey Richardson <kb1pkl at yahoo.com> wrote:

> Hello, python tutors, its Corey.
> Anyway, I'm getting a syntax error for an unknown reason. Here is my
> code...
>     name = raw_input("What is your name?")
> print "Hello, ", name
> wellness = raw_input("How are you?")
> if wellness != "Good":
>     if wellness != "Well":
>         if wellness != "Fine":
>             print "Oh, I'm sorry you are not feeling well. I guessed
> correct, right?"
>         else: print "Great!"
> candyNumber = raw_input("How many candies do you want? :"
>

It looks like you're missing a closing parenthesis.



> fat = raw_input("How many candies do you want to eat? :")
> if fat > candyNumber:
>     print "HA! Nice try, but no. You don't have that many candies"
>     else print "HA! You ate the candy! Suckerrrrr. You are now", fat, "lbs
> overweight"
> The syntax arror is at the first fat. Thanks ahead of time,
> ~Corey
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090924/382a92f7/attachment.htm>


More information about the Tutor mailing list