Python’s Logical Operator AND

Python Boolean operators return the last value evaluated, not True/False. The docs have a good explanation of this:

The expression x and y first evaluates x; if x is false, its value is returned; otherwise, y is evaluated and the resulting value is returned.

Leave a Comment