1 2 3 4 5 6 7 8 9 10 11
All Flashcards
What is a list?
A container that holds multiple values called elements.
What is an element (in the context of a list)?
An individual value within a list.
What is an index (in the context of a list)?
The position of an element in a list.
What is data abstraction?
Simplifying data by representing it in a general way.
Give an example of data abstraction using lists.
Representing a to-do list as a single list variable instead of multiple individual string variables.
How can lists be used to store and manage student grades?
A list can hold all grades for a student, allowing easy calculation of average or identifying highest/lowest scores.
How can lists be used to store and manage inventory in a store?
Each item can be an element in a list, storing information like name, quantity, and price.
How does AP Pseudocode index lists?
AP Pseudocode lists start at index 1.
Why is data abstraction useful?
It makes code neater, easier to edit, and simplifies element access.
How can strings be treated in relation to lists?
Strings are essentially ordered lists of characters.
Explain the concept of 'one-based' indexing.
Indexing starts at 1, not 0, for the first element in the list.