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

What is the value of [count * 2 for count in [1, 2, 3, 4] if count % 2 == 0]?

  1. [2, 4]
  2. [1, 2, 3, 4]
  3. [2, 6]
  4. [4, 8]Richtige Antwort

Erklärung

The filter admits the even inputs 2 and 4, and the expression doubles each admitted value to build the result. A list comprehension creates a new list rather than modifying the input list or returning a generator object.

Mit diesem Test weitermachen

Übung starten
Frage 72: What is the value of [count * 2 for count in [1, 2, 3, 4]… · Python Fundamentals · Questena