What Is a Data Structure?
A way to organise data.
A data structure is simply a way to organise data, so that you can use it easily. You already use them every day. A shopping list, a stack of plates, a queue at the shop, a family tree. Each one keeps things in a particular order, for a particular job.

- A way to organise data
- A list, a stack, a queue
- Each has a job
Everyday data structures
A shopping list keeps items in order, and you can add more at the end. That's like a Python list. A stack of plates only lets you take the top one. A queue at the shop serves whoever came first. And a phone book lets you jump straight to a name. That's like a dictionary.
You already use them
Here are three structures that come with Python. A list keeps things in order. A dictionary connects keys to values, like names to phone numbers. And a set holds unique items, so duplicates disappear. Run it. Notice the set only kept one copy of red.
shopping = ["milk", "eggs", "bread"]
phone = {"Priya": "0712", "Sam": "0788"}
colours = {"red", "blue", "red", "green"}
print(shopping[0])
print(phone["Sam"])
print(len(colours), "unique colours")milk 0788 3 unique colours
Summary
A data structure is a way to organise data for a job. Lists, dictionaries, and sets are three you already know. Next, what an algorithm is.
Key takeaways- Organise data for a job
- list, dict, set
- Each is good at something