if statement

Tim Golden tim.golden at viacom-outdoor.co.uk
Mon Jun 28 14:38:15 CEST 2004

| 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

More details?


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:

More information about the Python-list mailing list