Week 9 — Assignment (Adaptive Learning) · "Working With Lists"
Course: Introduction to Computer Science — CS1 / Programming Fundamentals in Python (CSCI 1101) · Silver Oak University (fictional sample) · Prof. Okafor
Objective assessed: Objective 6 (lists; mutation & methods; iterating; aliasing vs. copying; debugging) · 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 9 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 — which is the only reliable way to settle Problems 3 and 4.
Part 1 — Student Instructions (read this first)
What this is. An AI coach gives you four problems one at a time — you'll build and iterate a list, predict output after operations, trace an aliasing case, 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 1.
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 9 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. I already know print, variables, strings (indexing/slicing), if, while, for, and functions; this week is lists. 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.
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 list & iterate (max + average) ────────────
SHOW ME: "Write a program that stores these five test scores in a list: 88, 92, 79, 95, 88. Then use a for loop to (a) compute the AVERAGE and (b) find the HIGHEST score by iterating (don't use the built-in max for this one — practice the loop). Print the highest and the average."
VETTED ANSWER (run-verified):
scores = [88, 92, 79, 95, 88]
total = 0
biggest = scores[0]
for s in scores:
total = total + s
if s > biggest:
biggest = s
print("Highest:", biggest)
print("Average:", total / len(scores))
which prints Highest: 95 and Average: 88.4. The highest is 95; the average is 88.4 (a float — / makes a float). Accept any correct iteration: separate loops are fine, sum(scores)/len(scores) for the average is fine, but the MAX must be found by iterating (a loop comparing to a running biggest), not by calling max().
RUBRIC: 25 — list built + correct average 88.4 + correct highest 95 found by iterating (full). Partial: average right but max via max() instead of a loop (18); off-by-one in the max seed or a logic slip giving the wrong max (12–16); only one of the two computed (12).
FRESH VARIANT: "Store these temperatures in a list: 70, 65, 80, 72. Find the highest and the average by iterating." Answer (run-verified): Highest: 80, Average: 71.75. Same rubric.
──────────── PROBLEM 2 (25 points) — Predict the list after operations ────────────
SHOW ME: "Without running it first, predict EXACTLY what this program prints (both lines), then run it to confirm:
items = [5, 10, 15, 20]
items.append(25)
items.insert(0, 0)
items.pop(2)
print(items)
print(len(items))"
VETTED ANSWER (run-verified): first line [0, 5, 15, 20, 25], second line 5. WHY: append(25) → [5,10,15,20,25]; insert(0,0) → [0,5,10,15,20,25]; pop(2) removes index 2 (the 10) → [0,5,15,20,25]; length is 5.
RUBRIC: 25 — both lines correct AND a correct step-by-step reason (15 for [0, 5, 15, 20, 25], 10 for 5 + reasoning). Partial: list right, length wrong or weak reasoning (15); popped the wrong index (e.g., kept the 10) but traced the rest correctly (12).
FRESH VARIANT: "Predict and explain:
nums = [1, 2, 3]
nums.append(4)
nums.remove(2)
nums.sort()
print(nums)" Answer (run-verified): [1, 3, 4] (remove(2) deletes the value 2, then sort keeps ascending order). Same rubric.
──────────── PROBLEM 3 (25 points) — Trace an aliasing case ────────────
SHOW ME: "Trace this program by hand and predict BOTH printed lines, then run it to check. Explain WHY:
a = [10, 20, 30]
b = a
b[0] = 99
b.append(40)
print('a =', a)
print('b =', b)"
VETTED ANSWER (run-verified): a = [99, 20, 30, 40] and b = [99, 20, 30, 40] — they are IDENTICAL. WHY: b = a does not copy the list; it makes b a SECOND NAME for the same list. So b[0] = 99 and b.append(40) change the one shared list, and a sees every change. (If you wanted a untouched, you'd write b = a[:].)
RUBRIC: 25 — both lines correct (identical lists) (13) + correct aliasing reasoning that b = a shares one list (12). Partial: says a is unchanged [10, 20, 30] (the classic miss) but, after running, correctly explains aliasing = 12; both lists right but reason vague = 18.
FRESH VARIANT: "Trace and explain:
x = [1, 2, 3]
y = x
y.pop()
print('x =', x)
print('y =', y)" Answer (run-verified): x = [1, 2] and y = [1, 2] — pop() removes the last item from the one shared list. Same rubric.
──────────── PROBLEM 4 (25 points) — Find and fix the bug ────────────
SHOW ME: "This program is supposed to keep a SAFE backup of the scores before adding a new score — but the backup gets changed too:
scores = [88, 92, 79]
backup = scores
scores.append(0)
print('backup =', backup)
It prints backup = [88, 92, 79, 0] — the backup was wrecked. Tell me (a) WHY the backup changed, and (b) fix the program so the backup stays [88, 92, 79] while scores becomes [88, 92, 79, 0]."
VETTED ANSWER (run-verified): (a) backup = scores did NOT make a copy — it made backup a second NAME for the same list (aliasing), so appending to scores also changed backup; there was only ever one list. (b) Make a real copy with a slice (or list()):
scores = [88, 92, 79]
backup = scores[:]
scores.append(0)
print('scores =', scores)
print('backup =', backup)
which prints scores = [88, 92, 79, 0] and backup = [88, 92, 79]. (backup = list(scores) also works.)
RUBRIC: (a) 13 — identifies aliasing/"two names for one list" as the cause (7 for the right idea even if loosely worded). (b) 12 — corrected line uses scores[:] or list(scores) to copy. Partial credit for the right fix with a fuzzy explanation.
FRESH VARIANT: "This program crashes: nums = [10, 20, 30] then print(nums[3]). What error does Python give and why, and fix it so it prints the LAST item (30)?" Answer (run-verified): an IndexError (list index out of range) because valid indexes are 0–2 (there is no index 3); fix with print(nums[2]) or print(nums[-1]) → 30. Same rubric (a = names the error + reason; b = the 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 (accept lists with or without spaces). For the code-writing problem, 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. (Watch for the classic Problem 3 miss — claiming a is unchanged — and teach aliasing fully when it happens.)
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 9 ASSIGNMENT — Working With Lists
Student: [name] | Date: ___
Problem 1 (Build & iterate: max + average): a/25 — [one line]
Problem 2 (Predict list after operations): b/25 — [one line]
Problem 3 (Trace an aliasing case): 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/100from 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:
95/88.4,[0, 5, 15, 20, 25]/5, both lists[99, 20, 30, 40], the wrecked-then-fixed backup) 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. Problem 3 (aliasing) is also where a chatbot may itself mis-grade — its embedded key explicitly flags the "a is unchanged" miss.
Canvas placement block
canvas_object = Assignment
title = "Week 9 Assignment — Working With Lists (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 = 6
published = true
provenance = "~ Prof. Okafor's edition · Fall 2026 · built with thecoursemaker.com"
Traditional variant — for comparison. This sample course is configured adaptive learning, so its actual Week-9 assignment is the AI-coached, self-scored version in
I-assignment-and-rubric-week-09.md. This file shows the same Week-9 skills built the traditional way — the student writes the programs and submits them, and the instructor grades against the rubric — so you can see both formats side by side. (Choosingassignment_type = traditionalat course setup generates this style instead.)
Course: Introduction to Computer Science — CS1 / Programming Fundamentals in Python (CSCI 1101) · Silver Oak University (fictional sample) · Prof. Okafor
Objective assessed: Objective 6 (lists; mutation & methods; iterating; aliasing vs. copying; debugging) · SLO A (write & run a correct program) · SLO B (trace code; find & fix a defect)
Worth 100 points · Assignments group = 15% of the grade
The Assignment
This week is about Python's list: building one, changing it, looping over it, and understanding the aliasing surprise. In four short parts you'll write a program, predict output, trace an aliasing case, and fix a bug. Write and run your code in a free online Python editor (online-python.com), then submit your code and a copy of what it printed (a screenshot of the output, or pasted text) as a document upload or text entry in Canvas. You'll be graded on the rubric below — read it before you start.
Part 1 — Build a list & iterate (25 pts). Store these five test scores in a list: 88, 92, 79, 95, 88. Then use a for loop to compute the average and to find the highest score by iterating (practice the loop — don't use the built-in max for the highest). Print the highest and the average. Submit the code and its output.
Part 2 — Predict the list after operations (25 pts). For this program, (a) write down both printed lines before running it, and (b) explain your trace step by step. Then run it and note whether you were right.
items = [5, 10, 15, 20]
items.append(25)
items.insert(0, 0)
items.pop(2)
print(items)
print(len(items))
Part 3 — Trace an aliasing case (25 pts). For this program, (a) predict both printed lines before running it, and (b) explain why they come out the way they do. Then run it to check.
a = [10, 20, 30]
b = a
b[0] = 99
b.append(40)
print("a =", a)
print("b =", b)
Part 4 — Find and fix the bug (25 pts). This program is supposed to keep a safe backup of the scores before adding a new one, but the backup gets changed too:
scores = [88, 92, 79]
backup = scores
scores.append(0)
print("backup =", backup)
It prints backup = [88, 92, 79, 0] — the backup was wrecked. (a) Explain why the backup changed, and (b) fix the program so backup stays [88, 92, 79] while scores becomes [88, 92, 79, 0].
Integrity & AI note. This is your own work, submitted for grading. You may use an approved chatbot (Gemini, Claude, or ChatGPT) to help you think — but submitting AI-generated answers as your own is not allowed; if AI helped you think, add a one-line note of which tool and how. Always run your code before submitting — the output is the proof it works, and this week it's the only way to be sure about Parts 3 and 4. (Note: this is the traditional format. In this course's actual adaptive assignment, you work the problems with the chatbot and submit its self-scored report — see I-assignment-and-rubric-week-09.md.)
Rubric — 100 points
| Criterion (part) | Full credit | Partial | Little/none |
|---|---|---|---|
| Part 1 — Build & iterate (25) | List built; average 88.4 and highest 95 found by iterating (a loop, not max()) (25) |
Average right but max via max() (18); off-by-one/logic slip giving the wrong max, or only one computed (12–16) |
No working list / neither computed (0–8) |
| Part 2 — Predict after operations (25) | Both lines correct ([0, 5, 15, 20, 25] and 5) and a correct step-by-step trace (25) |
List right, length wrong or weak reasoning (15); popped the wrong index but traced the rest (12) | Wrong list and reasoning (0–8) |
| Part 3 — Trace aliasing (25) | Both lines identical ([99, 20, 30, 40]) and correct reasoning that b = a shares one list (25) |
Says a is unchanged but, after running, explains aliasing correctly (12); both right, reason vague (18) |
Wrong output and reasoning (0–8) |
| Part 4 — Find & fix the bug (25) | Identifies aliasing as the cause and fixes with scores[:] (or list(scores)) so the backup stays [88, 92, 79] (25) |
Right fix with a fuzzy explanation, or correct cause but no working fix (10–18) | Neither cause nor fix correct (0–8) |
Levels describe observable differences so grading stays fast and consistent. (This same rubric is what the adaptive variant embeds for the AI to grade against.)
Instructor answer key — REMOVE BEFORE PUBLISHING TO STUDENTS
Execution gate: PASS — every program and output below was produced by running the code in Python.
- Part 1 (model):
python scores = [88, 92, 79, 95, 88] total = 0 biggest = scores[0] for s in scores: total = total + s if s > biggest: biggest = s print("Highest:", biggest) print("Average:", total / len(scores))
Output (run-verified):
Highest: 95 Average: 88.4
The highest is 95 (found by the loop); the average is 88.4 (a float, since/always produces a float). Accept separate loops orsum(scores)/len(scores)for the average, but the max must be found by iterating, not by callingmax(). - Part 2: trace →
append(25)gives[5,10,15,20,25];insert(0,0)gives[0,5,10,15,20,25];pop(2)removes index 2 (the10) giving[0,5,15,20,25]. Output (run-verified):
[0, 5, 15, 20, 25] 5 - Part 3:
b = amakesba second name for the same list, sob[0] = 99andb.append(40)change the one shared list andasees both. Output (run-verified):
a = [99, 20, 30, 40] b = [99, 20, 30, 40]
The two lines are identical — that's the whole point. (To leaveauntouched, the second line would have to beb = a[:].) - Part 4: (a)
backup = scoresdid not copy the list — it aliased it (one list, two names), so appending toscoresalso changedbackup. (b) Make a real copy with a slice:
python scores = [88, 92, 79] backup = scores[:] scores.append(0) print("scores =", scores) print("backup =", backup)
Output (run-verified):
scores = [88, 92, 79, 0] backup = [88, 92, 79]
backup = list(scores)is an equally correct fix.
Canvas placement block
canvas_object = Assignment
title = "Week 9 Assignment — Working With Lists (traditional)"
assignment_group = "Assignments"
points_possible = 100
grading_type = points
assignment_type = traditional
submission_types = [online_upload, online_text_entry]
due_offset_days = 6
published = true
rubric_ref = "week-09-assignment-rubric"
provenance = "~ Prof. Okafor's edition · Fall 2026 · built with thecoursemaker.com"
~ Prof. Okafor's edition · Fall 2026 · built with thecoursemaker.com