On Wed, Sep 2, 2009 at 4:30 AM, Anthony Casey <[email protected]> wrote:
> Hello, tutors. > > I'm someone who used to programme as a hobby and who is trying to get back > into it via Python. I'm reading Programming in Python 3 by Summerfield > (excellent book). > > I read something unusual about Boolean operations in Python: > > >>> five = 5 > >>> two = 2 > >>> zero = 0 > >>> five and two > 2 > > I understand what it's doing here: returning the operand. But what is the > practical application of that? How might I use that function? > (Short-sighted > imagination, I realise.) > > (I know how binary Booleans work etc., so this is a bit of a change of > outlook.) > > Please pardon me if this is a silly or inane question. > > Regards, > Anthony > > _______________________________________________ > Tutor maillist - [email protected] > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > this might make the "and" operator a little clearer http://pyref.infogami.com/and Vince
_______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
