← Python Programming learning path
Python Programming · Module 7 of 10

Lists, tuples and dictionaries

Store many values in lists, fixed groups in tuples, and key-value pairs in dictionaries.

📖 Key ideas

  1. A list holds items in order and can change: marks = [80, 90].
  2. append(), insert(), remove(), sort() change a list.
  3. A tuple is like a list but cannot change: point = (3, 4).
  4. A dictionary maps keys to values: student = {"name": "Asha", "age": 20}.
  5. A set keeps unique values only.
💡 Real-life example: A list is a shopping list, a tuple is your date of birth (fixed), a dictionary is a phone book (name to number).
listOrdered collection that can change
tupleOrdered collection that cannot change
dictKey-value pairs
setUnique values only