Path: csiph.com!goblin3!goblin.stu.neva.ru!panix!gordon From: John Gordon Newsgroups: comp.lang.python Subject: Re: if else python Date: Thu, 26 Nov 2015 13:25:41 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 19 Message-ID: References: NNTP-Posting-Host: panix1.panix.com X-Trace: reader1.panix.com 1448544341 7511 166.84.1.1 (26 Nov 2015 13:25:41 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Thu, 26 Nov 2015 13:25:41 +0000 (UTC) User-Agent: nn/6.7.3 Xref: csiph.com comp.lang.python:99572 In Scott Montreuil 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@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies"