Week 3 — Assignment (Adaptive Learning) · "Input, Slice & Fix"
Course: Introduction to Computer Science — CS1 / Programming Fundamentals in Python (CSCI 1101) · Silver Oak University (fictional sample) · Prof. Okafor
Objective assessed: Objective 2 (input/output & strings) · SLO A (write & run a correct interactive program) · SLO B (trace slice/index output; 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 3 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, slice strings, and the habit of this course is to confirm output by running it, not guessing — especially on slices.
Part 1 — Student Instructions (read this first)
What this is. An AI coach gives you four problems one at a time — you'll write an interactive program, slice a string, predict a slicing expression, 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, Sep 20.
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 3 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. I have learned input() (always returns a string), int(input()), f-strings, string indexing/slicing (exclusive stop), and len() — keep everything at that level (no if-statements, loops, functions, or string methods like .upper()).
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 greeting from input ────────────
SHOW ME: "Write a program that asks the user for their name with input(), then prints a personalized greeting using an f-string. For example, if they type Maria, it should print: Welcome, Maria!"
VETTED ANSWER: uses input() to capture the name and an f-string to build the output, e.g.:
name = input("Your name: ")
print(f"Welcome, {name}!")
which (if the user types Maria) displays:
Welcome, Maria!
ACCEPT any program that (1) reads a name with input() and (2) uses an f-string (the f before the quote with {name} inside) to print a greeting that includes the name and would run without error. Exact wording of the greeting is the student's choice. If they build the output with + concatenation instead of an f-string, award partial (the assignment is specifically practicing f-strings).
RUBRIC: 25 — input() captures the name AND an f-string builds a greeting containing it (full). Partial: f-string but no input (15); input but plain string with no substitution / forgot the f so it prints {name} literally (12); concatenation with + instead of an f-string but otherwise correct (18).
FRESH VARIANT: "Write a program that asks for the user's name AND their major (two input() calls), then prints one sentence using an f-string, e.g. for Maria / Biology: Maria is studying Biology." VETTED: name = input("Name: ") / major = input("Major: ") / print(f"{name} is studying {major}.") → Maria is studying Biology. Same rubric (two inputs + one f-string).
──────────── PROBLEM 2 (25 points) — Slice the string ────────────
SHOW ME: "Here is a string: s = "COMPUTER". Write three print statements that use slicing/indexing to display exactly: (a) the first three letters COM, (b) the last letter R, and (c) everything from index 4 to the end, UTER. Run it to confirm each."
VETTED ANSWER (run-verified):
s = "COMPUTER"
print(s[:3]) → COM
print(s[-1]) → R
print(s[4:]) → UTER
ACCEPT equivalents that produce the same output (e.g., s[0:3] for COM). The OUTPUTS must be COM, R, UTER.
RUBRIC: 25 — all three correct slices/indices producing COM, R, UTER (full; ~8 each). Partial: each correct part earns ~8; a slice that's off by one (e.g., s[:4] → COMP, or s[3:] → PUTER) earns 0 for that part. If they hard-code the letters as string literals instead of slicing, max 8 total.
FRESH VARIANT: "For s = "KEYBOARD", print (a) the first three letters (KEY), (b) the last letter (D), and (c) indices 3 through 6 (BOA)." VETTED: print(s[:3])→KEY; print(s[-1])→D; print(s[3:6])→BOA. Same rubric.
──────────── PROBLEM 3 (25 points) — Predict the slice ────────────
SHOW ME: "Without running it first, predict what this program prints, then explain WHY: s = "RAINBOW" then print(s[2:5]). After you answer, run it to confirm."
VETTED ANSWER: it prints INB. WHY: the slice s[2:5] takes positions 2, 3, 4 — the stop index 5 is EXCLUDED — and R=0, A=1, I=2, N=3, B=4, O=5, W=6, so positions 2,3,4 are I, N, B → INB. (NOT INBO, which would wrongly include index 5.)
RUBRIC: 25 — correct output INB (13) + correct reasoning that the stop is exclusive / positions 2,3,4 (12). Partial: right output, weak/missing reason = 13; says INBO (included the exclusive stop) but then explains the exclusive-stop rule after running = 10.
FRESH VARIANT: "Predict and explain: s = "LIBRARY" then print(s[1:4])." VETTED: IBR (positions 1,2,3 — L=0,I=1,B=2,R=3 — stop 4 excluded), not IBRA. Same rubric.
──────────── PROBLEM 4 (25 points) — Find and fix the bug ────────────
SHOW ME: "This program is supposed to compute how old someone is from the year they were born, but it crashes: year = input("Year born: ") then print("You are about", 2026 - year, "years old"). Tell me (a) what error Python gives and why, and (b) the corrected program."
VETTED ANSWER: (a) a TypeError (unsupported operand type(s) for -: 'int' and 'str') — because input() always returns a string, so year is the string like '2000', and you can't subtract a string from the number 2026. (b) The fix is to convert the input to an integer: year = int(input("Year born: ")) then print("You are about", 2026 - year, "years old") — if the user types 2000, it prints You are about 26 years old.
RUBRIC: (a) 13 — identifies that the input is a string and that's why the math fails (names TypeError or describes it; 7 for the string-cause even if they label the error loosely). (b) 12 — corrected line uses int(input(...)). Partial credit for the right int() fix with a fuzzy explanation.
FRESH VARIANT: "This crashes: s = "HELLO" then print(s[5]). What error, why, and what's the fix?" VETTED: an IndexError (string index out of range) because "HELLO" has length 5, so valid indices are 0–4 and 5 is one past the end; the fix is s[4] or s[-1] (both → O). Same rubric structure: (a) 13 names/explains the IndexError + off-by-one; (b) 12 gives a valid 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/slice problems, if my code would error or my slice is off, tell me to RUN it and read the output, 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). For slices, walk the index positions.
• 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 3 ASSIGNMENT — Input, Slice & Fix
Student: [name] | Date: ___
Problem 1 (Greeting from input): a/25 — [one line]
Problem 2 (Slice the string): b/25 — [one line]
Problem 3 (Predict the slice): 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:
Welcome, Maria!,COM/R/UTER,INB, theTypeError→int()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. (Problem 3's exclusive-stop reasoning is the most common place a chatbot will over-credit a wrong
INBOanswer — the embedded key tells it the correct output isINB.)
Canvas placement block
canvas_object = Assignment
title = "Week 3 Assignment — Input, Slice & Fix (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-3 assignment is the AI-coached, self-scored version in
I-assignment-and-rubric-week-03.md. This file shows the same Week-3 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 2 (input/output & strings) · SLO A (write & run a correct interactive program) · SLO B (trace slice/index output; find & fix a defect)
Worth 100 points · Assignments group = 15% of the grade
The Assignment
This week your programs learned to read input, build output with f-strings, and slice strings. In four short parts you'll write an interactive program, slice a string, predict a slice, 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 — for the input programs, note what you typed) 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 greeting from input (25 pts). Write a program that asks the user for their name with input(), then prints a personalized greeting using an f-string (the f before the quote, with {name} inside) — for example, if they type Maria, it prints Welcome, Maria!. Submit the code and a sample run.
Part 2 — Slice the string (25 pts). Start with s = "COMPUTER". Write three print statements that use slicing/indexing to display exactly: (a) the first three letters COM, (b) the last letter R, and (c) everything from index 4 to the end, UTER. Submit the code and its output.
Part 3 — Predict the slice (25 pts). For the program s = "RAINBOW" then print(s[2:5]): (a) write down what you think it prints before running it, and (b) explain why in one or two sentences. Then run it and note whether your prediction was right.
Part 4 — Find and fix the bug (25 pts). This program is supposed to compute how old someone is from the year they were born, but it crashes:
year = input("Year born: ")
print("You are about", 2026 - year, "years old")
(a) Name the error Python gives and explain why it happens, and (b) give the corrected program.
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 slices especially need a run to confirm. (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-03.md.)
Rubric — 100 points
| Criterion (part) | Full credit | Partial | Little/none |
|---|---|---|---|
| Part 1 — Greeting from input (25) | input() captures the name and an f-string prints a greeting containing it (25) |
Forgot the f so {name} prints literally, or used + concatenation instead of an f-string, or f-string but no input (12–18) |
No working input / no f-string / no output shown (0–8) |
| Part 2 — Slice the string (25) | All three produce COM, R, UTER (25; ~8 each) |
Each correct part ~8; an off-by-one slice (s[:4]→COMP, s[3:]→PUTER) earns 0 for that part (8–18) |
Hard-coded the letters instead of slicing (0–8) |
| Part 3 — Predict the slice (25) | Correct output INB and correct exclusive-stop reasoning (positions 2,3,4) (25) |
Right output, weak/missing reason, or INBO first but exclusive stop explained after running (10–18) |
Wrong output and reasoning (0–8) |
| Part 4 — Find & fix the bug (25) | Identifies the input-is-a-string cause (TypeError) and gives the int(input(...)) fix (25) |
Right fix with a fuzzy explanation, or correct cause but no 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: reads a name and builds a greeting with an f-string, e.g.:
python name = input("Your name: ") print(f"Welcome, {name}!")
Output (run-verified, withMariatyped):
Welcome, Maria!
Exact greeting wording is the student's; what matters isinput()+ an f-string that substitutes the name. Forgetting thef(prints{name}literally) or using+concatenation is partial credit. - Part 2: for
s = "COMPUTER"(run-verified):
python print(s[:3]) # COM print(s[-1]) # R print(s[4:]) # UTER
s[0:3]is an accepted equivalent forCOM. Off-by-one slices (s[:4]→COMP) lose that part. - Part 3: output is
INB(run-verified). Reasoning: the slices[2:5]takes positions 2, 3, 4 — the stop index 5 is excluded — and in"RAINBOW", positions 2,3,4 areI,N,B. NotINBO(that wrongly includes index 5). - Part 4: (a) Python raises a
TypeError(unsupported operand type(s) for -: 'int' and 'str') becauseinput()always returns a string, soyearis text (e.g.'2000') and you can't subtract a string from the number2026. (b) The fix converts the input to an integer:
python year = int(input("Year born: ")) print("You are about", 2026 - year, "years old")
Output (run-verified, with2000typed):You are about 26 years old.
Canvas placement block
canvas_object = Assignment
title = "Week 3 Assignment — Input, Slice & Fix (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-03-assignment-rubric"
provenance = "~ Prof. Okafor's edition · Fall 2026 · built with thecoursemaker.com"
~ Prof. Okafor's edition · Fall 2026 · built with thecoursemaker.com