Question #94

What is the output of the code snippet below?
my_list = []
print(bool(my_list))

As the list object implements a __len__() method that returns zero when called with the object, an empty list is considered False . (docs.python.org/3/library/stdtypes.html#truth-value-testing)


Comment on Disqus:

Comment on Twitter:

Question difficulty: 🔵🔵🔵🔵🔵


Similar questions: