Start learning →
Home › CS Olympiad › Computer Science › Booleans and Decisions › When an if else statement runs, the number of br…

When an if else statement runs, the number of branches actually taken is:

A1
B2
C0
D3
Answer & Solution
Correct answer: A. 1
1. The condition is either true or false, never both. 2. Exactly one body therefore runs. 3. So 1 branch is taken. _Source: OpenStax Introduction to Python Programming, Chapter 4._
Practise this question with Quill — CS Olympiad →
Related questions