The previous quiz asked you a few questions about whether certain numbers or objects evaluate to True  or False . It's not really something you have to know by heart, but over time you'll just know whether something evaluates to True  or False .

By the way, when we say "evaluates to True or False" we really mean this:

my_list = []
bool(my_list)  # False

another_list = [None]
bool(another_list)  # True

Your classes in Python can implement a magic method, __bool__ , which will tell bool() , if statements, and the sort, whether your object should evaluate to True  or False .

If you don't implement __bool__ , then __len__  will be used—if it returns 0  it will evaluate to False ; otherwise it will evaluate to True .

Finally, if you don't implement either __bool__  or __len__ , your object will always evaluate to True .

Learn more here: https://docs.python.org/3/library/stdtypes.html#truth-value-testing

Happy coding!

Kind regards,

Jose and the Teclado team