Week 10 — Module Framing · Tuples, Dictionaries & Sets
Course: Introduction to Computer Science — CS1 / Programming Fundamentals in Python (CSCI 1101) · Silver Oak University (fictional sample) · Prof. Okafor
Module: Week 10 of 16 · Fall 2026 · in-person, two 75-minute coding-along studio sessions
Objective covered: Objective 6 — Use Python's core collections — lists, tuples, dictionaries, and sets — and choose the right one for a problem.
This file holds two pieces: (A) the Module 10 Overview page ("Start Here") and (B) the Welcome Announcement that drips out when the module opens. Dates below assume a Tuesday/Thursday pattern with Week 10 meeting Tue Nov 3 and Thu Nov 5, a Coding Lab that same week, and end-of-week work due Sunday Nov 8, 11:59 p.m. Adjust the day-of-week and times to match your section.
(A) Module 10 Overview — Start Here
Welcome to Week 10: Tuples, Dictionaries & Sets
This is your home base for the week. Read it first, then work the checklist below from top to bottom. Everything you need is linked inside the module.
Last week you met your first collection — the list — an ordered, changeable bag of items. This week we add the other three collections Python gives you, and the skill that ties them together: picking the right one. You'll learn the tuple (an ordered group you can't change), the dictionary (a lookup table that maps a key to a value — a phone book in code), and the set (an unordered bag that automatically throws away duplicates). Then you'll learn to ask the question a real programmer asks before writing a line: which collection fits this job?
These collections each fail in their own signature way, and this week is about meeting those failures on purpose: assigning to a tuple element raises a TypeError, and asking a dictionary for a key it doesn't have raises a KeyError. As always in this course, you won't take my word for any of it — you'll run it and read exactly what Python does.
The week's big question
"When you have a pile of data, which container should you reach for — and how do you look things up without crashing?"
By Friday you'll build a dictionary and look things up in it safely, dedupe a list with a set in one line, explain why a tuple won't let you change it, and match each collection to the job it's best at.
By the end of this week, you can…
Use this as a checklist. If you can do all five, you're ready for the quiz.
- [ ] Use a tuple — create one with
(a, b), read its items by index, unpack it (x, y = point), and explain immutability (whypoint[0] = 9raises aTypeError). - [ ] Use a dictionary — create
{key: value}, look upd[key], add and update entries, and iterate over it with.keys(),.values(), and.items(). - [ ] Look up safely — know that a missing key raises a
KeyError, and avoid it with.get()or anincheck. - [ ] Use a set — create one, dedupe a list with
set(...), and test membership within(and explain why sets have no order). - [ ] Choose the right collection — list vs. tuple vs. dict vs. set, by what the job needs (order? changeability? key→value lookup? uniqueness?).
What's due this week, and when
Work these in order — each one gets you ready for the next.
| # | Do this | Type | Due |
|---|---|---|---|
| 1 | Read the week's readings + watch the linked videos | Read / watch (ungraded prep) | Before Thu Nov 5 |
| 2 | Skim the slides (Deck 10) and the Week 10 lecture outline | Prep (ungraded) | Alongside class |
| 3 | Lecture Tutorial 10 — work through tuples & immutability, dictionaries (lookup, .get(), KeyError), sets, and choosing a collection with one approved chatbot (Gemini, Claude, or ChatGPT), then submit the conversation share link |
Lecture Tutorial · graded (5% group) | Sun Nov 8, 11:59 p.m. |
| 4 | Practice exercises — low-stakes reps to lock in the ideas | Practice · ungraded | Sun Nov 8 (recommended) |
| 5 | Coding Lab 10 — "Map It, Dedupe It, Lock It" — build a dictionary and a set in a free online Python environment, run a predict-then-run table of dict/set/tuple operations, and fix a KeyError and a tuple-mutation bug — then catch the AI when it claims a set keeps its order or invents a dict value |
Coding Lab · graded (Coding Labs, 15% group) · 50 pts | Sun Nov 8, 11:59 p.m. |
| 6 | Quiz 10 — predict dict lookup/update output, set dedup/membership, tuple immutability, KeyError debugging, and "which collection?" |
Quiz · graded (Quizzes, 10% group) | Sun Nov 8, 11:59 p.m. |
| 7 | Discussion 10 — "Open Source vs. Proprietary: Should Code Be Free or Owned?" — weigh whether software should be free and open or owned and sold, in a dialogue with one approved chatbot, then post the AI summary + your chat link and reply to two classmates | Discussion · graded (Discussions, 10% group) | Initial post Fri Nov 6; replies Sun Nov 8 |
| 8 | Assignment 10 — "Build a Lookup, Dedupe a List" — build a word-frequency dictionary, dedupe with a set, predict dict/set output, choose the right collection, and fix a KeyError/tuple-mutation bug, coached and scored by one approved chatbot |
Assignment · graded (Assignments, 15% group) · 100 pts | Sun Nov 8, 11:59 p.m. |
Heads-up on the AI tools: you'll use a chatbot as a pair-programmer to draft and explain — and then you check its work by running the code. This week the AI's favorite mistakes are perfect practice: it will confidently tell you a set prints its elements in the order you typed them (it doesn't — sets are unordered), or invent a value for a dictionary key that isn't there (instead of admitting it would be a KeyError). Catching that — by running the code and reading the real output — is the point, in the tutorial, the assignment, and the lab.
How to succeed this week
- Picture each collection as a real-world thing. A tuple is a sealed pair of coordinates
(latitude, longitude)— fixed. A dictionary is a phone book — you look up a name (key) and get a number (value). A set is a guest list where each person appears once. A list is a numbered to-do list you can reorder and edit. .get()is your seatbelt.d[key]crashes with aKeyErrorif the key is missing;d.get(key)hands backNoneinstead, andd.get(key, default)hands back a fallback. Reach for.get()whenever a key might not be there.- A set is the one-line dedupe. Got a list with repeats and just want the unique items?
set(my_list). Want a count of distinct things?len(set(my_list)). - Tuples don't bend. If a "change" needs to happen, a tuple makes you build a new one. That's a feature — it protects data that should never change. (And
ages = {"Sam": 20}; print(ages["Ada"])doesn't printNone— it crashes. Predict it, then run it.) - Run, then trust — especially the AI. Before you believe a printed dictionary or set, run it. And when the chatbot predicts an output this week, assume it's wrong about set ordering until you've confirmed it yourself.
You don't need any setup for this week — the Python environment runs in your browser, nothing to install. Come ready to build a phone book and a guest list in code. See you Tuesday.
(B) Welcome Announcement — Module 10
Release setting: post on the module's start day (offset = 0 days), i.e., Tue Nov 3, 2026 — not before. If your platform won't preserve the scheduled date on import, post this as a draft labeled "Release: Tue Nov 3."
Subject: Week 10 — phone books, guest lists, and locked-down pairs (tuples, dicts & sets) 📒
Hi everyone,
Last week you got your first collection, the list. This week we add the other three — and honestly, the dictionary might be the most useful data structure you learn all term. It's a lookup table: hand it a key (a name) and it hands back a value (a phone number). Once you can think in key→value, a huge class of real programs opens up — counting words, tallying votes, storing settings, looking up a price.
This week — Tuples, Dictionaries & Sets — we tackle the big question: When you have a pile of data, which container should you reach for, and how do you look things up without crashing? By Friday you'll build a dictionary, dedupe a list with a set in a single line, explain why a tuple refuses to change, and choose the right collection for a job.
Three things not to miss:
1. Lecture Tutorial 10 — work through tuples, dictionaries, sets, and "which collection?" with one approved chatbot (Gemini, Claude, or ChatGPT) and submit the share link. You'll use it as a pair-programmer — and catch its mistakes by running the code. Due Sun Nov 8.
2. Coding Lab 10 ("Map It, Dedupe It, Lock It"), Quiz 10, Discussion 10, and Assignment 10 also close Sun Nov 8 — the lab is where you build a real dictionary and a real set and watch the dictionary fill up key by key in Python Tutor, so start early.
3. Open the Start Here page first — it lays out everything in order with due dates.
One habit to keep sharp this week: never trust an output you didn't run — especially from a chatbot. Sets have no order, and AI tools love to forget that and predict a set printing in the order you typed it; and a lookup on a missing key doesn't quietly return nothing — it raises a KeyError. The source of truth is the same as always: run the code and read what Python actually prints.
Bring your curiosity (and a guess about what {1, 2, 2, 3} actually prints) to class on Tuesday.
See you soon,
Prof. Okafor
~ Prof. Okafor's edition · Fall 2026 · built with thecoursemaker.com