Back to the Introduction to Computer Science outline The Course Maker
Introduction to Computer Science outline
Week 10 · Readings & resources

Week 10 — Readings & Resources · Tuples, Dictionaries & Sets

Introduction to Computer Science · CSCI 1101 Fall 2026 · Prof. Okafor Fictional sample

Course: Introduction to Computer Science — CS1 / Programming Fundamentals in Python (CSCI 1101) · Silver Oak University (fictional sample) · Prof. Okafor
Objective covered: Objective 6 — Tuples (immutability), dictionaries (key → value lookup), sets (uniqueness), and choosing the right collection.


How to use this page

Everything here is a link to an external resource — open it in your browser. Nothing needs to be downloaded or installed; the Python environments below run in the browser.

This week is the dictionary week as much as anything — dictionaries are the most-used collection in Python, so spend most of your reading time there. The fastest way to learn this material is the same as always: type the examples and run them. Build a tiny phone book, look up a key, then look up a key that isn't there and watch the KeyError.

Order that matches the lecture: ① tuples & immutability → ② dictionaries (lookup, add/update, .get(), KeyError, iterating) → ③ sets (dedup, membership, unordered) → ④ choosing the right collection.

A habit to keep this week: never trust a printed set's order (sets are unordered), and never assume a missing-key lookup returns None (it raises a KeyError). Before you believe what a page — or a chatbot — says a collection prints, paste it into the runner and run it yourself.


① Your Tools — open these first (you use them every week)

Run Python in your browser — a free online editor (no install)
🔗 https://www.online-python.com/
Why it earns the click: this is where you build this week's dictionary and set and watch set([1,2,2,3]) drop the duplicate. Type, press Run, read the output. (A second option if you want it: 🔗 https://www.programiz.com/python-programming/online-compiler.)
⏱ 2 min to open and run a tiny dictionary

See your code run, step by step — Python Tutor
🔗 https://pythontutor.com/
Why it earns the click: the best way to watch a dictionary fill up key by key, or see a set refuse a duplicate. Paste a program, click Visualize Execution, and step forward. We use it in the Coding Lab.
⏱ ~5 min


② Dictionaries — the heart of the week

Maps to Lecture Segments 3–5. Build {key: value}, look up d[key], add/update, use .get() to dodge the KeyError, and iterate with .items().

Read & do — "Python Dictionary" (Programiz)
🔗 https://www.programiz.com/python-programming/dictionary
Why it's assigned: the cleanest single page on dictionaries — creating {key: value}, accessing by key, adding/updating, the .get() method, iterating, len(), the membership test with in, and the all-important note that keys must be immutable (so a tuple can be a key but a list can't). Read it, then build the phone book from class and run it. A short video sits at the bottom.
⏱ ~12 min

Read — "Dictionaries" + "Sets" (official Python Tutorial, §5.5 and §5.4)
🔗 https://docs.python.org/3/tutorial/datastructures.html
Why it's assigned: the source of truth. Read §5.5 Dictionaries for the exact behavior we rely on — that a missing-key lookup d[key] raises a KeyError, and that .get() returns None (or a default) instead — and §5.4 Sets for "an unordered collection with no duplicate elements." This is the official statement of everything in class, straight from the people who make Python.
⏱ ~12 min (read §5.3 Tuples, §5.4 Sets, §5.5 Dictionaries)

Interactive — "Python Dictionaries" (W3Schools)
🔗 https://www.w3schools.com/python/python_dictionaries.asp
Why it earns the click: a friendly, click-through tour of dictionaries with a green "Try it Yourself" button on every example, so you run dictionary code right on the page. Good for a second pass if the Programiz page went fast.
⏱ ~8 min


③ Tuples & Sets

Maps to Lecture Segments 2 and 6. A tuple (a, b) is immutable (point[0] = 9TypeError); a set {...} keeps only unique values and is unordered.

Read & do — "Python Tuple" (Programiz)
🔗 https://www.programiz.com/python-programming/tuple
Why it's assigned: short and practical on tuples — creating (a, b), indexing, unpacking, and the headline that tuples are immutable (you can't change an element). Try the immutability example and read the TypeError for yourself.
⏱ ~7 min

Read & do — "Python Set" (Programiz)
🔗 https://www.programiz.com/python-programming/set
Why it's assigned: covers creating a set, that it holds unique items (duplicates vanish), membership with in, and that sets are unordered. Run the set([1, 2, 2, 3]) dedupe and confirm the repeat is gone.
⏱ ~7 min


Optional one-stop references (free online)

  • Programiz — "Getting Started with Python" (full tutorial index). Free, well-organized, and it covers lists, tuples, dictionaries, and sets in order — a good place to review all four collections side by side.
    🔗 https://www.programiz.com/python-programming
  • The official Python Tutorial — index. Your reference all term; §5 (Data Structures) is this week and next.
    🔗 https://docs.python.org/3/tutorial/index.html
  • W3Schools — Python. Click-through tutorials with "Try it Yourself" on every example (lists, tuples, sets, dictionaries each have their own page).
    🔗 https://www.w3schools.com/python/

Pick-one quick path (≈15 min total)

In a hurry? Do exactly these two and you'll be ready for the quiz:
1. Read the Programiz "Python Dictionary" page (group ②), then in the editor build phone = {"Sam": 5551234}, run phone["Sam"], and run phone["Ada"] to see the KeyError — then fix it with phone.get("Ada").
2. Run print(set([1, 2, 2, 3, 3])) and print({1, 2, 2, 3}) in the editor and watch the duplicates disappear (groups ②–③). Notice you can't predict a set's print order — that's the point.

Heads-up (links rot): these point to outside sites that occasionally move or rename pages. If a link ever fails, tell Prof. Okafor and use the official Python Tutorial (docs.python.org/3/tutorial/datastructures.html) or W3Schools (w3schools.com/python) in the meantime.

~ Prof. Okafor's edition · Fall 2026 · built with thecoursemaker.com