if else python

John Gordon gordon at panix.com
Thu Nov 26 08:25:41 EST 2015


In <mailman.51.1448431821.20593.python-list at python.org> Scott Montreuil <scott at zml.ca> writes:

> I have an if statement which seems to run both commands and I cannot
> figure out why.

I'm not sure what you mean by "both commands".  Do you mean that the
'if' and 'else' branches both execute?

Your if/else branches are in a loop, so perhaps you're seeing the 'if'
branch on one loop iteration, anf the 'else' branch on the next iteration?

I see that your if and else branches both contain a screen.addstr()
call.  Are you seeing both of these outputs?

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon at panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"




More information about the Python-list mailing list