The quiz where the difficulty automagically adapts to the player's Python knowledge
This is a question page. You can use this page to bookmark a question. Start a new quiz!
Question #875
print(bool([]) * True)
In Python, the boolean True evaluates to 1. Also, the boolean() function returns False is an empty list is passed to it. As such, bool([]) * True will return 0. (problemsolvingwithpython.com/04-Data-Types-and-Variables/...)
What is the output of the code snippet below?
— The Python Quiz (@thepythonquiz) October 5, 2020
my_list = []
print(bool(my_list))
True
False#python #python3 #pythonprogramming #learnpython
Question difficulty: π΅π΅π΅π΅π΅
Similar questions: