# Dictionaries > Tenth graders store data as key-value pairs with a dictionary. Instead of a numbered position, each value has a meaningful key — like capitals[‘France’]… **Computer Science** | **Grade 10** *A free lesson plan from K12 Academics. Source page: https://lessonplans.k12academics.com/k12-lesson-g10-cs-dictionaries.html* Tenth graders store data as key-value pairs with a dictionary. Instead of a numbered position, each value has a meaningful key — like capitals[‘France’] gives ‘Paris’. They match keys to values, then build and look up data in a dictionary. **Copy link** works with Canvas, Schoology, Moodle and any other LMS — paste it in as a resource or assignment. ## Everything you need before the bell rings ### Learning Objectives Students will be able to… - Explain a **key-value** pair. - Look up a value by its **key**. - Add and update **entries**. - Build a dictionary. How do you store and look up data by a meaningful key? ## Match Each Key to Its Value Project this and match each key (country) to its value (capital) — tap the key, then tap the value. ## 55 minutes, five moves Tap any phase to open the teacher moves and student actions. ### Hook — Look It Up by Name How would you store each country’s capital for instant lookup? #### 👩‍🏫 Teacher Moves - Show a lookup by name. - Ask how to store it. - Set the goal. #### 🎒 Student Actions - Look. - Guess. - Get ready. ### Use — Dictionaries Students use the idea. #### 👩‍🏫 Teacher Moves - Send students to Match Key to Value. - Match each one. - Note key → value lookup. #### 🎒 Student Actions - Match. - Say. - Note it. ### Modify — Change Entries Students modify. #### 👩‍🏫 Teacher Moves - Look up a value by its key. - Add a new key-value pair. - Update an existing value. #### 🎒 Student Actions - Look up. - Add. - Update. ### Create — Build a Dictionary Students create. #### 👩‍🏫 Teacher Moves - Make a dictionary (name → score). - Add 4 entries. - Look up and print one. #### 🎒 Student Actions - Make. - Add. - Look up. ### Reflect — Reflect Students close. #### 👩‍🏫 Teacher Moves - Say what a key is. - Say how you look up a value. - Complete the exit ticket. #### 🎒 Student Actions - Say it. - Say. - Complete the exit ticket. ## Built to the standards you report on Aligned to the CSTA K-12 Computer Science Standards and the ISTE Standards for Students. Create prototypes that use data to solve problems. Use data structures to reduce complexity. Combine control structures with data. Organize data to build solutions. ## One lesson, every learner ### Multilingual Learners - Use a phonebook analogy. - Frame: “key unlocks a value.” - Point key to value. ### Support & Access - Use 3 pairs. - Look up one value. - One key at a time. ### Stretch & Extend - Loop over all keys. - Use a value that is a list. - Count items with a dictionary. ### What to gather - 📽️Screen / board - 🗝️Key/value cards - 💻Match Key to Value - 🐍Python / editor - 📓Notebooks - 🎫Exit-ticket slips ### Key terms - **dictionary**: data stored as key-value pairs - **key**: the label you look up by - **value**: the data stored for a key - **pair**: a key and its value together - **lookup**: getting a value from its key - **entry**: one key-value pair - **update**: change the value for a key - **unique key**: each key appears once ## Exit Ticket Preview the three formative checks. Tap “Sample answer” to see what mastery looks like — hide them before you print for students. ### Reflect: dictionaries. Have students build a 4-entry dictionary and look up one value. A printable dictionaries worksheet is in the Computer Science library. ## Check your understanding **1. What does “dictionary” mean?** - the label you look up by - change the value for a key - data stored as key-value pairs *(correct)* - a key and its value together “dictionary” means: data stored as key-value pairs **2. Which word means: “the label you look up by”?** - unique key - update - key *(correct)* - pair “key” means: the label you look up by **3. What does “value” mean?** - getting a value from its key - each key appears once - data stored as key-value pairs - the data stored for a key *(correct)* “value” means: the data stored for a key **4. Which word means: “a key and its value together”?** - pair *(correct)* - unique key - dictionary - lookup “pair” means: a key and its value together **5. What does “lookup” mean?** - one key-value pair - getting a value from its key *(correct)* - the label you look up by - each key appears once “lookup” means: getting a value from its key **6. Which word means: “one key-value pair”?** - update - entry *(correct)* - lookup - pair “entry” means: one key-value pair ## Printable worksheet --- Full lesson page: https://lessonplans.k12academics.com/k12-lesson-g10-cs-dictionaries.html All lessons: https://lessonplans.k12academics.com/