"Donald Bedsole" <drbeds...@gmail.com> wrote

False or thing = thing

Thanks for your response and for  the rules, but for some reason I'm
not understanding.  In the above quote, what is meant by "thing"?

Any Boolean value, and in Python that means pretty much
anything at all because Python has a set of rules over how
it converts values to booleans.

More or less it is that:
None, empty strings, lists etc , zero, are all False,
anything else is True

You can check by explicitly converting:

spam = "foo"  # or any other value
print bool(spam)

HTH,


--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to