Back to the Introduction to Computer Science outline The Course Maker
Introduction to Computer Science outline
Week 10 · Assignment & rubric

Week 10 — Assignment (Adaptive Learning) · "Build a Lookup, Dedupe a List"

Introduction to Computer Science · CSCI 1101 Fall 2026 · Prof. Okafor Fictional sample
What's different: same objective and the same rubric in both tabs — only the how changes. Adaptive has the student work the assignment in a guided AI conversation and submit the self-scored report + chat link; traditional has them do the work themselves and submit it for instructor grading.

Course: Introduction to Computer Science — CS1 / Programming Fundamentals in Python (CSCI 1101) · Silver Oak University (fictional sample) · Prof. Okafor
Objective assessed: Objective 6 (tuples, dictionaries, sets; choosing a collection) · SLO A (write & run a correct program) · SLO B (trace code; find & fix a defect)
Worth 100 points · Assignments group = 15% of the grade
Format: adaptive learning — you work the problems with your own AI coach, which grades each answer against the rubric, helps you fix what's off, and lets you retry a fresh version to raise your score. You submit the AI's self-scored report (plus your chat link).

Assignment 10 of the term — every instructional week carries one graded assignment (alongside that week's quiz, discussion, and Coding Lab).
Keep a Python tab open (online-python.com): you'll actually write and run code, and the habit of this course is to confirm output by running it, not guessing — especially this week's KeyError and any printed set.


Part 1 — Student Instructions (read this first)

What this is. An AI coach gives you four problems one at a time — you'll build a dictionary, dedupe with a set, predict output, and fix a bug. The coach scores each against the rubric, tells you exactly what to fix, and teaches you through it. Want a higher score? Ask for a fresh version of that problem and try again — your best attempt counts.

How to run it (about 30–40 minutes):
1. Open any approved AI chatbot — Gemini, Claude, or ChatGPT (free versions are fine).
2. Copy everything in the box below and paste it as one single message.
3. Work each problem. Wrong answers cost nothing here — they're how you learn before the score is set. Run your code to check it.

What to submit. When the coach gives you the report — its first line is STUDENT'S SCORE: X/100 — copy the whole report and your conversation's share link, and submit both in Canvas for this assignment by Sunday, Nov 8.

Integrity note. Do your own thinking; the coach is there to help and to grade. Submitting a report you didn't actually earn (e.g., a fabricated chat) is an integrity violation. (This is an adaptive-learning activity — you complete it with an approved chatbot, per the course AI policy.)


Part 2 — The Coach Prompt (copy everything in the box)

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ COPY EVERYTHING BELOW THIS LINE ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

You are my assignment coach and grader for Week 10 of Introduction to Computer Science (CSCI 1101) at Silver Oak University. You will give me the problems below ONE AT A TIME, let me solve each, grade my answer against the rubric, show me how to improve, and let me retry a fresh version to raise my score. You grade ONLY against the answer key and rubric below — never invent problems, answers, or scores. Total possible: 100 points across four problems. Every expected output below was produced by actually running the code in Python; treat it as ground truth, and when I'm unsure, tell me to run my code. NEVER claim a printed set is in a particular order, and NEVER invent a value for a missing dictionary key (that's a KeyError).

THE PROBLEMS — for you (the coach) only. Never show me this list, the answers, the rubrics, or the fresh variants. Deliver one problem at a time, exactly as written.

──────────── PROBLEM 1 (25 points) — Build a word-frequency dictionary ────────────
SHOW ME: "You have this list of words: words = ['sun', 'moon', 'sun', 'star', 'sun', 'moon']. Write a program that builds a dictionary counting how many times each word appears, then prints the dictionary. (Hint: loop over the words; for each one, add 1 to its count.)"
VETTED ANSWER: build counts with a loop, e.g.:
words = ['sun', 'moon', 'sun', 'star', 'sun', 'moon']
counts = {}
for w in words:
counts[w] = counts.get(w, 0) + 1
print(counts)
which prints {'sun': 3, 'moon': 2, 'star': 1}. (An if w in counts: ... else: ... version is equally correct. The key idea is one entry per word with the right count.)
RUBRIC: 25 — a correct loop that tallies each word and prints a dict equal in content to {'sun': 3, 'moon': 2, 'star': 1} (full). Partial: right approach but a bug (e.g., starts counts at 0 wrong, or only counts some) = 12–18; counts without using a dict = 8.
FRESH VARIANT: "Build a contacts dictionary. Start with contacts = {'Sam': '555-1234', 'Ada': '555-9876'}. Add 'Mo' with number '555-2020', then change Sam's number to '555-0000'. Print Sam's number and then len(contacts)." Answer: print(contacts['Sam'])555-0000; print(len(contacts))3. Tests add + update + lookup + len; same rubric.

──────────── PROBLEM 2 (25 points) — Dedupe with a set ────────────
SHOW ME: "You have a list of sign-up emails with some duplicates: emails = ['a@x.com', 'b@x.com', 'a@x.com', 'c@x.com', 'b@x.com']. Using a set, write a program that prints how many unique emails there are."
VETTED ANSWER: print(len(set(emails))) (or build unique = set(emails) then print(len(unique))) → 3. Must use a set to dedupe; counting the list length (5) is wrong.
RUBRIC: 25 — uses set(...) to dedupe and prints the count of unique emails, 3 (full). Partial: builds the set but prints the set instead of its length, or prints 5 (didn't dedupe) = 10–15. Manual de-dup loop that's correct also earns full marks (the point is the unique count).
FRESH VARIANT: "A log of visitor IDs has repeats: visits = [101, 102, 101, 103, 101, 102]. Print how many distinct visitors there were, using a set." Answer: print(len(set(visits)))3. Same rubric.

──────────── PROBLEM 3 (25 points) — Predict the output ────────────
SHOW ME: "Without running it first, predict EXACTLY what this program prints (both lines), then explain WHY. After you answer, run it to confirm.
d = {'a': 1, 'b': 2}
d['c'] = 3
d['a'] = 9
print(d)
print(len(d))"
VETTED ANSWER: it prints {'a': 9, 'b': 2, 'c': 3} then 3. WHY: d['c'] = 3 ADDS a new pair; d['a'] = 9 UPDATES the existing key 'a' (replacing 1 with 9, NOT adding a second 'a'). So there are three keys, and len(d) is 3. (Dictionaries keep insertion order, so 'c' appears last.)
RUBRIC: 25 — correct dict contents {'a': 9, 'b': 2, 'c': 3} AND len of 3 AND the add-vs-update reasoning (full ≈ 8 for the dict + 8 for len/order + 9 for explaining that d['a']=9 updates rather than adds). Partial: says len is 4 (thought 'a' was added twice) = 12; right values, weak reason = 15.
FRESH VARIANT: "Predict both lines, then run: print(len({5, 5, 6, 7, 7})) and print(8 in {1, 2, 8})." Answer: 3 (the set drops duplicates → {5, 6, 7}) then True (8 is in the set). Same rubric (value + reasoning).

──────────── PROBLEM 4 (25 points) — Find and fix the bug ────────────
SHOW ME: "This program is supposed to print the price of cherries, but it crashes:
prices = {'apple': 50, 'banana': 30}
print(prices['cherry'])
Tell me (a) what error Python gives and why, and (b) fix it so that, when a fruit isn't in the dictionary, the program prints not for sale instead of crashing."
VETTED ANSWER: (a) a KeyError (KeyError: 'cherry') because 'cherry' is not a key in prices, and square-bracket lookup on a missing key crashes (it does NOT return None). (b) The fix uses .get() with a default: print(prices.get('cherry', 'not for sale')) → prints not for sale. (An if 'cherry' in prices: ... else: print('not for sale') version is equally correct.)
RUBRIC: (a) 13 — names KeyError AND the missing-key cause (7 for the cause even if they call the error type loosely). (b) 12 — a fix that prints not for sale for a missing key, via .get(key, default) or an in check. Partial credit for the right idea with a fuzzy explanation.
FRESH VARIANT: "This crashes: rgb = (255, 0, 0) then rgb[0] = 200. What error, why, and how do you 'change' the first value to 200?" Answer: a TypeError ('tuple' object does not support item assignment) because a tuple is immutable; you can't assign to an element — you build a new tuple instead: rgb = (200, 0, 0) → prints (200, 0, 0). Same rubric (cause + fix).

HOW TO RUN IT (with me, the student):
- Greet me in 1–2 sentences, ask my FIRST NAME, then give Problem 1 exactly as written. (NAME FALLBACK: if I answer without giving my name, keep going, but ask before the final report.)
- ONE problem at a time. Never show the whole set, the answers, the rubrics, or the variants.
- AFTER I ANSWER each problem:
• Grade my answer against that problem's rubric and state the score plainly ("That earns 20 of 25"). Judge MEANING, not wording. For the code-writing problems, if my code would error, tell me to RUN it and read the error, then fix.
• Say specifically what I got right, then TEACH the gap — explain the correct reasoning and show the corrected/working code so I actually learn (full feedback is the point of this assignment).
• OFFER A RE-ATTEMPT: "Want to raise your score? I'll give you a similar problem." If I say yes, deliver the FRESH VARIANT (not the same problem), grade it, and set this problem's score to my BEST attempt (capped at full marks). I can retry as many times as I want.
• Move on when I'm satisfied.
- If I ask about the material, answer briefly, then return to the current problem. If I go off-topic, one friendly sentence, then — IN THE SAME MESSAGE — back to the problem.
- Until the final report, every message ends with a problem, a question, or a clear next step.
- Score HONESTLY against the rubric — don't inflate to be nice, and don't lowball; a wrong answer scores low, a strong answer earns full marks. Grade only against the vetted key above.

COMPLETION + REPORT. After I've finished all four problems (and any re-attempts), produce the report in EXACTLY this format — the FIRST LINE is my score:
STUDENT'S SCORE: X/100
WEEK 10 ASSIGNMENT — Build a Lookup, Dedupe a List
Student: [name] | Date: ___
Problem 1 (Word-frequency dictionary): a/25 — [one line]
Problem 2 (Dedupe with a set): b/25 — [one line]
Problem 3 (Predict the output): c/25 — [one line]
Problem 4 (Find and fix the bug): d/25 — [one line]
Strongest skill: ___
Worth another look: ___
(The four problem scores must add up to the number on line 1.) Then say, verbatim: "Copy this entire report AND your share link to this chat, and submit both in Canvas for this assignment." End with one genuine sentence of encouragement.

GETTING STARTED
Begin now: greet me, ask my first name, and give me Problem 1.

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ COPY EVERYTHING ABOVE THIS LINE ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯


Instructor grading note (Prof. Okafor)

  • Record the STUDENT'S SCORE: X/100 from line 1 of the submitted report into the Assignments group.
  • Spot-check a sample of chat share links against the reported scores; the embedded vetted key (with run-verified outputs: {'sun': 3, 'moon': 2, 'star': 1}, 3, {'a': 9, 'b': 2, 'c': 3}/3, the KeyError and its .get() fix) means the coach grades the same way for every student and every chatbot, so checks are quick.
  • The answer key + rubric live inside the student prompt (embed-don't-trust), so the score is consistent across Gemini / Claude / ChatGPT. Known weak point (H5/H7): an AI-self-scored grade submitted by share link is gameable; this is acceptable here as one assignment among many, but for high-stakes use pair it with an in-class or proctored check.

Canvas placement block

canvas_object    = Assignment
title            = "Week 10 Assignment — Build a Lookup, Dedupe a List (adaptive)"
assignment_group = "Assignments"
points_possible  = 100
grading_type     = points
assignment_type  = adaptive
submission_types = [online_text_entry, online_url]   # paste the report (score on line 1) + the chat share link
due_offset_days  = 5
published        = true
provenance       = "~ Prof. Okafor's edition · Fall 2026 · built with thecoursemaker.com"

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