~1 min read|
By default, an object is considered true unless its class defines either a bool() method that returns False or a len() method that returns zero, when called with the object. Here are most of the built-in objects considered false:
Estefania Cassingena Navone, in her Introduction to Truthy and Falsey Values in Python, separates the falsey values into three groups: Sequences and Collections, Numbers, and Constants:
Sequences and Collections:
Hi there and thanks for reading! My name's Stephen. I live in Chicago with my wife, Kate, and dog, Finn. Want more? See about and get in touch!