Question Detail
Question
Consider the following Python code snippet:
If the value of
if score >= 50:
print("Pass")If the value of
score is 45, what will be the output?
Correct Answer
Option B is the correct answer.
Detailed Explanation
Page 6 illustrates this syntax. If
score is 45, the condition score >= 50 (45 >= 50) is False. When the condition is False, the indented code block (print("Pass")) is skipped entirely, as shown on Page 7. Therefore, nothing is printed.
Hint
What happens when the condition in an 'if' statement evaluates to False?