QuestenaÜben und erkennen, was als Nächstes dran ist
Frage 56

Which description of `x < y <= z` is accurate?

  1. It means `x < y` or `y <= z`.
  2. It means `x < y` and `x <= z`.
  3. It requires `x < y` and `y <= z`, with one evaluation of `y`.Richtige Antwort
  4. It is invalid syntax because comparisons cannot be chained.

Erklärung

The chain requires both neighboring comparisons to hold and evaluates the middle expression only once. Comparing `x` directly with `z` for the second test changes the meaning, while writing two separate comparisons can reevaluate `y`.

Mit diesem Test weitermachen

Übung starten
Frage 56: Which description of `x < y <= z` is accurate? · Python Fundamentals · Questena