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  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to