# Flashcards: 06-collections

**Front:** list

**Back:** fruits = ["apple", "banana", "cherry"] stores many values in order.

---

**Front:** index

**Back:** fruits[0] is the first item; positions start at 0.

---

**Front:** last item

**Back:** fruits[-1] is the last item.

---

**Front:** append

**Back:** fruits.append("orange") adds "orange" to the end.

---

**Front:** replace

**Back:** fruits[1] = "pear" replaces one item by position.

---

**Front:** list loop

**Back:** for fruit in fruits: handles every item, however many there are.

---

**Front:** dictionary

**Back:** student = {"name": "Mia", "age": 9} stores entries by label.

---

**Front:** key

**Back:** In {"name": "Mia"}, "name" is the key, the label.

---

**Front:** value

**Back:** In {"name": "Mia"}, "Mia" is the value stored under the key.

---

**Front:** items

**Back:** for k, v in student.items(): loops through key-value pairs together.

---

**Front:** KeyError

**Back:** student["missing"] gives a KeyError.

---

**Front:** str

**Back:** str(9) converts the number 9 to text, so it can join a message.

---

