QuestenaPractice that shows what to review next
Question 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]]`Correct answer
  4. `[[1], [2], [3]]`

Explanation

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`.

Continue with this test

Start practice
Question 26: After `items = [1]` and `items.append([2, 3])`, what is… · Python Fundamentals · Questena