Choose a list or dictionary for a roster — quick review
A class has a seating order and a room for each student.
Use a list when the order or position of values matters, and read it by index. Use a dictionary when values are looked up by a key such as a name, and read it by key. Keys of a dictionary are unique; values and list items may repeat.
Write the questions the program must answer.
If a question asks by position, such as first or next, keep a list.
If a question asks by a name or code, keep a dictionary with that name as the key.
Check the keys: each key holds one value only.
Use both when the program needs both kinds of question.
Using a name as a list index stops the program: seats["Cy"] raises a TypeError, because a list index is a whole number. Keep a dictionary for lookups by name.
Using one dictionary for values that share a key loses one of them: storing a second value with the same key replaces the first.