variable question

Terry Reedy tjreedy at udel.edu
Thu Jul 10 07:49:41 CEST 2008



Support Desk wrote:
> 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. 

When things do not work as you expect, post minimal actual code that 
does not work, what happened, and if not obvious, what you expected 
different.




More information about the Python-list mailing list