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 #214
a = True
print(('A', 'B')[a == False])
Here ('A', 'B') is a tuple. The a == False is an expression that is evaluated as boolean. In Python 3 True and False are keywords and will always be equal to either 1 or 0. So the result will be A. (w3schools.com/python/python_booleans.asp)
What is the output of the code snippet below?
— The Python Quiz (@thepythonquiz) November 1, 2020
a = True
print(('A', 'B')[a == False])
B
A#python #python3 #pythonprogramming #learnpython
Question difficulty: π΅π΅π΅π΅π΅
Similar questions: