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

After `items = [1]` and `items.append([2, 3])`, what is `items`?

  1. `[1, 2, 3]`
  2. `[1]` because append returns no value
  3. `[1, [2, 3]]`Richtige Antwort
  4. `[[1], [2], [3]]`

Erklärung

The argument to `append` becomes one new final element even though that argument is itself a list. Adding its two contents separately would be the behavior of `extend`, not `append`.

Mit diesem Test weitermachen

Übung starten
Frage 26: After `items = [1]` and `items.append([2, 3])`, what is… · Python Fundamentals · Questena