Physics I / Lists, arrays, and structured storage
Practice question · Select all that apply

Which operations modify a Python list in place?

Hints
  1. Ask whether each call returns a new object or changes the original.
  2. An operation that only reports something cannot be modifying anything.
Show the answer
  • C. reverse()
  • D. append(x)
Why

sorted() returns a new list; len() only reads. append and reverse mutate.

Read the lesson: Lists, arrays, and structured storage →

Practise Lists, arrays, and structured storage

The app has 6 more questions on this lesson, and keeps your place in the course. Physics I is free to start.

More questions on Lists, arrays, and structured storage