Coding · Grade 7
Python Functions and Data Structures
Learners extend their list skills with insert, remove, pop, slicing, in and sorting, then meet dictionaries for looking values up by key, including tallying with counts. They see how functions interact with mutable lists and dictionaries, and decide when a list, a dictionary or a combination of both best fits a task.
- 4 lessons
- About 85 minutes
- Check what you learned: 8 questions
- Ways to answer: choose an answer, put code in order, trace code, type a number, sort into groups and true or false
What learners will discover
- Use list operations: insert, remove, pop, slicing, in, sorted() and sort().
- Create, look up, update and loop over dictionaries, and avoid KeyErrors with in or get().
- Write functions that take and return lists and dictionaries, and predict when a function changes the caller's data.
- Choose a list, a dictionary or a combination for a task and justify the choice.
Lessons
-
More tools for lists 7 steps4 practiceabout 20 min
-
Dictionaries: look things up by key 6 steps4 practiceabout 22 min
-
Functions that work with lists and dictionaries 6 steps4 practiceabout 20 min
-
Choosing the right data structure 5 steps3 practiceabout 16 min
-
Check what you learned 8 questions at the end
Keep exploring
Games to practice with
- Bug DetectiveA robot program almost works. Run it, spot the buggy block, and fix it.
- Sorting FactoryTurn a work order into if/else rules and watch the conveyor sort every item.
- Garden AutomationProgram a garden robot with sensor rules — then watch a whole day play out.
More 7th grade coding
- 7th Grade Coding Games4 games to play free
- 7th Grade Coding Worksheets11 printable worksheets
Guide for grown-ups
- How to start homeschooling: a step-by-step guide for familiesA guide for parents · 7 min read