Questenaتدريب يوضح لك ما ينبغي مراجعته لاحقًا
السؤال 49

In one `if`, `elif`, `else` chain, both the `if` condition and an `elif` condition are truthy. Which suite executes?

  1. Only the suite under the first truthy `if` conditionالإجابة الصحيحة
  2. Both the `if` and `elif` suites
  3. Only the `elif` suite
  4. The `if` suite followed by the `else` suite

الشرح

The chain selects the first truthy condition, executes its suite, and skips all later alternatives. Running the `elif` suite as well would treat mutually exclusive branches as independent `if` statements.

تابع هذا الاختبار

بدء التدريب
السؤال 49: In one `if`, `elif`, `else` chain, both the `if` condition… · Python Fundamentals · Questena