QuestenaPráctica que te muestra qué repasar después
Pregunta 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` conditionRespuesta correcta
  2. Both the `if` and `elif` suites
  3. Only the `elif` suite
  4. The `if` suite followed by the `else` suite

Explicación

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.

Continúa con este test

Empezar la práctica
Pregunta 49: In one `if`, `elif`, `else` chain, both the `if` condition… · Python Fundamentals · Questena