if statement

Ajay abra9823 at mail.usyd.edu.au
Mon Jun 28 08:33:04 EDT 2004


hi!

i get an error with the following code:

num=0
if contextForm.has_key("number"):
    num=contextForm["number"].value
else:
    num=0
num += 1

any idea why?
the increment num+=1 is meant to be outside the if-else block

thanks

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





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




More information about the Python-list mailing list