Data Abstraction
Introduced| English | Meaning |
|---|---|
| complexity/kəmˈpleksɪti/ | complexity |
| Data abstraction/ˈdeɪtə əbˈstrækʃn/ | Representing data through a useful interface or structure while hiding details that are unnecessary for a particular task. |
| list/lɪst/ | An abstract data type that groups many values under one name. |
| abstract data type/ˈæbstrækt ˈdeɪtə taɪp/ | A specification of stored values and permitted operations that does not depend on a particular implementation. |
| general/ˈdʒenərəl/ | general |
| abstraction/əbˈstrækʃn/ | Representing essential features while leaving out unnecessary detail. |
| modeling/ˈmɒdəlɪŋ/ | modeling |
| model/ˈmɒdl/ | A simplified representation of a system used to explain, analyse or predict its behaviour. |
Hiding detail to manage complexity
- Real programs deal with a lot of data.
- Data abstraction 数据抽象 hides detail so we can manage complexity 复杂性.
- Instead of tracking many small pieces separately, we group them under one name.
- The most common tool for this is a list 列表.
Use a list, or one variable?
A list (data abstraction) is worth it when you have many similar values; a single variable is enough for one standalone value.
Data abstraction helps a programmer by:
Difficulty 1/5 · 100 coins + a small bonus on first completion today
Grouping data under one name hides needless detail.
A ______ groups many values under one name, like all the marks of a class.
Difficulty 1/5 · 100 coins + a small bonus on first completion today
A list is the most common abstract data type.
Using a list makes code general: the same loop works for 5 or 500 values.
Difficulty 1/5 · 100 coins + a small bonus on first completion today
The code refers to the list by name, not to each value.
Lists group many values
- A list is an abstract data type 抽象数据类型 that groups many values under one name.
- One list
scorescan hold a whole class's marks — not a separate variable per student. - Using a list makes code more general 通用: the same code works with 5 values or 500.
- It refers to the list by name, not to each value one by one.

One list replaces many separate variables; list indexes start at 1
Which are benefits of data abstraction? (Select all that apply)
Difficulty 2/5 · 140 coins + a small bonus on first completion today
One clear name beats fifty separate ones on all three counts.
Why abstraction helps
- Less repetition — you write the logic once, not once per value.
- Easier changes — add a value to the list and the same code still works.
- Fewer mistakes — one clear name is easier to get right than fifty separate names.
- This naming and grouping is the heart of abstraction 抽象.
A model of a class stores names but ignores eye colour because:
Difficulty 1/5 · 100 coins + a small bonus on first completion today
A model simplifies reality, keeping only the relevant detail.
With a list, adding a sixth student needs a new variable and a new print line.
Difficulty 1/5 · 100 coins + a small bonus on first completion today
False. Only the data changes: the student is added to the list, and the same loop handles it.
Abstraction is modeling
- Data abstraction is a form of modeling 建模.
- A model 模型 simplifies something so we can focus on what matters.
- A list of student names models a class, ignoring details like eye colour the program never needs.
Five marks. Without abstraction: five variables mark1…mark5 and five print lines. With a list marks: one loop prints every element. If a sixth student joins, only the data changes — no new variable, no new line.
Data abstraction hides detail to manage complexity, usually with a list — an abstract data type grouping many values under one name. It makes code general (works for any size), reduces repetition and mistakes, and is a kind of modeling: keep what matters, ignore the rest.