if statement

Ajay abra9823 at mail.usyd.edu.au
Mon Jun 28 08:44:39 EDT 2004


syntax error, invalid syntax is what i got

thanks

--
Ajay Brar,
CS Honours 2004
Smart Internet Technology Research Group


Quoting Tim Golden <tim.golden at viacom-outdoor.co.uk>:

> | Ajay >
> |
> | i get an error with the following code:
> |
> | num=0
> | if contextForm.has_key("number"):
> |     num=contextForm["number"].value
> | else:
> |     num=0
> | num += 1
>
> *What* error do you get? Is it an indentation error?
> Does it run but produce the wrong result? Does it
> give a Syntax error?
>
> With the trivial addition of "contextForm = {}" at
> the top, it runs without error on Python 2.2.3 under
> Win2K.
>
> More details?
>
> TJG
>
>
> ________________________________________________________________________
> This e-mail has been scanned for all viruses by Star Internet. The
> service is powered by MessageLabs. For more information on a proactive
> anti-virus service working around the clock, around the globe, visit:
> http://www.star.net.uk
> ________________________________________________________________________
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




More information about the Python-list mailing list