What is the output of the following Python code snippet?
x = 3
print('big' if x > 5 else 'small')
print('big' if x > 5 else 'small')
Correct answer
D. small
D. small
The conditional (ternary) expression selects a value by condition.
Asked in: Python Interview Control Flow
https://docs.python.org/3/tutorial/controlflow.htmlNot sure why the answer is D? Ask here and get an explanation.