Data Abstraction Homework
Quick practice with Python lists
📝 Data Abstraction Hack (10 minutes)
Instructions
In this activity, you’ll learn how lists manage data and reduce complexity in programs. Follow these steps:
- Edit the
students
list to use your own names (friends, classmates, etc.). - Edit the
scores
list to assign each student a score of your choice. - Save and refresh the page in your browser to see how the output changes automatically.
- After experimenting with
students
andscores
, complete the 🚀 Hack Challenge at the bottom. - To make edits, open VS Code and find the file at
notebooks/csp/big-ideas/2025-09-26-bigidea32homework.ipymd
.
Class Roster Output:
🚀 Hack Challenge
Now that you’ve practiced with students
and scores
,
it’s your turn! Create one new list of your choice.
✅ Ideas:
- A list of
favoriteFoods
- A list of
cities
you want to visit - A list of
videoGames
you enjoy
After creating your new list, write a loop to print each element to the page.
// Example structure: let favoriteFoods = ["Pizza", "Burgers", "Sushi"]; for (let i = 0; i < favoriteFoods.length; i++) { console.log(favoriteFoods[i]); // Replace console.log with output to the page if you like }
💡 Hint: Use the same pattern you saw with students
and scores
.