variable question

Support Desk support.desk.ipg at gmail.com
Wed Jul 9 15:39:09 EDT 2008


I am trying to assign a variable using an if / else statement like so:

 

If condition1:

            Variable = something

If condition2:

            Variable = something else

Do stuff with variable.

 

But the variable assignment doesn't survive outside the if statement. Is
there any better way to assign variables using an if statement or exception
so I don't have to write two almost identical if statements. This is
probably a dumb question.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080709/37c9e0d7/attachment.html>


More information about the Python-list mailing list