BEGINNER PYTHON · CHAPTER 08

Python lists for beginners

Store and transform collections using Python lists, indexes, methods, and iteration.

Practice Python lists →Download the chapter notebook

Understanding lists

Lists hold multiple values in order and can be changed after they are created. Practice accessing elements, appending values, traversing a list, and connecting lists with strings. Pay attention to whether a method changes the original list or returns a new value.

scores = [7, 9, 8]
scores.append(10)
print(len(scores))  # 4
print(sum(scores))  # 34

append() changes scores in place. len() counts the items and sum() adds their numeric values.

What you will practice

Work through eight coding missions, then test your understanding with ten multiple-choice questions. Each mission provides starter code, a hint, and feedback after you run it.

  1. Index and mutate — A list is a sequence; Lists are mutable
  2. Combine, repeat, and slice — List operations; List slices
  3. Append, extend, and sort — List methods
  4. Remove an element — Deleting elements
  5. Lists and string methods — Lists and strings
  6. Copy without aliasing — Objects and values; Aliasing; Debugging
  7. Unique words in a file — Exercises: Exercise 4
  8. A guarded mail reader — Debugging: Lists, split, and files; Exercises 2 and 5

Your chapter progress is saved in this browser. Complete all 18 checks to unlock a certificate at your earned practice score, and download your notebook or grade report to keep a copy.

Read, practice, and try again

For the chapter reading, see Python for Everybody: Lists by Charles R. Severance (CC BY 4.0). ZHUDDLE adds its own practice activities and scoring. The browser runs Python after its first interpreter download; no local installation is required.

Start the lists exercises →