Question #124

What is the output of this code snippet?

The __bool__() method of lists returns True when the list is not empty, and False when the list is empty. Here, the outer list is not empty has it contains another (empty) list. As such, bool([[]]) returns True . (

Comment on Disqus:

Comment on Twitter:

Question difficulty: πŸ”΅πŸ”΅πŸ”΅πŸ”΅πŸ”΅

Similar questions: