PyPyPath

Module 5: Lists in Python

List Properties

Lists have three important properties: they keep order, you can change them, and they allow duplicate values.

About 8 minutes

1. Ordered

Items stay in the order you put them. The first item is always first unless you move it.

2. Mutable (changeable)

You can add, remove, or change items after creating the list — unlike tuples later.

3. Allow duplicates

Example code
scores = [90, 85, 90, 92]
print(scores)  # 90 appears twice — that is OK
List vs future tuple (preview)

List [ ]

Ordered, changeable

Tuple ( )

Ordered, fixed — later

In data science, lists of numbers often become NumPy arrays later — faster for big math.

Practice

Make a list with duplicate numbers. Print it to see duplicates are allowed.

Key takeaways

  • Lists are ordered — position matters.
  • Lists are mutable — you can change them.
  • Duplicate values are allowed.

Quick check: List Properties

Question 1 of 2

Mutable means: