Chapter 11 - Python Quest
Data Records
Mix lists and dictionaries into the bigger shapes real programs use.
XP
0Level 1Stars
0/12quest starsCombo
0clean runsRank
Seed0/160 Python scoreDictionaries of lists
100 XPBackpack Total
A field trip helper sorts a backpack into snack, school, and treasure pockets.
Write backpack_total(backpack) so it returns how many items are packed across every category.
Sample checks
backpack_total({"snacks":["apple","crackers"],"school":["pencil"],"treasures":[]})returns3Explanation: two snacks and one school item
backpack_total({"snacks":["cookie"],"tools":["map","compass"],"treasures":["rock","shell"]})returns5Explanation: several full pockets
Hint
Hints are ready when you want one.
Lesson reference
Review: Dictionary values can be lists
Your Python
backpack_total
Loading editor
Judge
Ready
Run your code when it feels ready.
