Warm Up (5 minutes)
Activity (30 minutes)
Wrap Up (10 minutes)
list.length
LIST: an ordered collection of elements
ELEMENT: an individual value in a list that is assigned a unique index
INDEX: a common method for referencing the elements in a list or string using numbers
list.length: evaluates the number of items in the list and generates a number
Note: Lists are an example of data abstraction. They allow us to name and program with large collections of information while ignoring the low level details of how the data is stored, organized, etc. These programs are easier to develop and maintain.
In this lesson students work with partners to investigate three different apps that use lists. Students first explore all three apps without seeing the code to notice similarities and predict how they will work. Then they explore the code itself and make additions and modifications to the apps. To conclude the lesson, students review and discuss common programming patterns with conditionals.
After building a conceptual model for list and list operations in the previous lesson, this lesson allows students to see how they are actually implemented in code. This lesson also introduces common programming patterns when using lists. Students will have some opportunities to modify working code in this lesson, but the most significant practice with lists will come in the following lesson.
CSP Conceptual Framework
AAP-1 - To find specific solutions to generalizable problems, programmers represent and organize data in multiple ways.
AAP-1.A - Represent a value with a variable.
AAP-1.D - For data abstraction: a. Develop data abstraction using lists to store multiple elements. b. Explain how the use of data abstraction manages complexity in program code.
CSTA K-12 Computer Science Standards (2017)
AP - Algorithms & Programming
3A-AP-14 - Use lists to simplify solutions, generalizing computational problems instead of repeated use of simple variables.
3B-AP-23 - Evaluate key qualities of a program through a process such as a code review.