[Tutor] a logic problem in an if statement
wallenpb at gmail.com
Mon Sep 27 02:17:22 CEST 2010
On Sun, Sep 26, 2010 at 5:12 PM, Steven D'Aprano <steve at pearwood.info>wrote:
> On Mon, 27 Sep 2010 06:01:35 am Bill Allen wrote:
> Now your decision logic becomes simple, and obvious. It documents
> if click_in_bottom_half1 and click_in_bottom_half2:
> print "Both clicks in bottom half of screen"
> elif click_in_bottom_half1:
> print "The first click was in the bottom half."
> print "The second click was in the top half."
> elif click_in_bottom_half2:
> print "The first click was in the top half."
> print "The second click was in the bottom half."
> print "Both clicks in top half of screen"
> Steven D'Aprano
Those are great suggestions and certainly do simplify matters quite a bit.
I had not realized the I was including such redundancies into my code. I
have some other code I need to now go back through and see what
simplifications I can there also make.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor