Week 1 — Coding Lab / Programming Studio · "Hello, Run, Fix"
Course: Introduction to Computer Science — CS1 / Programming Fundamentals in Python (CSCI 1101) · Silver Oak University (fictional sample) · Prof. Okafor
Objective: Objective 1 — write & run a first program; trace code and predict output; read an error and fix it · SLO A (write & run) + SLO B (trace & debug)
Worth 50 points · Coding Labs group = 15% of the grade · Coding Lab 1
Format: a hands-on programming studio worked in a free online Python environment — you'll (a) write short programs, (b) trace code and predict its output, and (c) find and fix a bug — and then catch the AI's mistake when it predicts an output.
This is the course's signature weekly component. Every instructional week has one Coding Lab. Everything runs in your browser — nothing to buy or install. The whole habit of this lab (and this course): don't guess what code does — run it and read what Python actually prints.
Part 1 — The Big Picture
This week you learned the loop every programmer lives in: EDIT → RUN → READ the output → FIX → repeat. This lab is that loop, three times: you'll write code, trace code (predict its output, then run to check), and debug code (find and fix what's broken). By the end you'll have written your first programs and read your first error messages — the foundation everything else is built on.
Your tools (both free, both in the browser):
- An online Python editor to write and run code: 🔗 https://www.online-python.com/ (or 🔗 https://www.programiz.com/python-programming/online-compiler)
- Python Tutor to watch code run step by step: 🔗 https://pythontutor.com/ — paste a program, click Visualize Execution, then step forward.
Part 2 — Setup (2 minutes)
- Open the online Python editor in a new tab.
- Delete any sample code so you have a blank editor.
- Type
print("Hello, world!")and press Run. You should seeHello, world!in the output area. You just ran a program. 🎉
Part 3 — (a) Write: Your First Programs
Write each of these in the editor, run it, and paste your code and its output into your submission.
- Greeting. Write a program that prints your first name on one line and one thing you want to learn this term on the next line. (Two
printstatements.) - Let Python do the math. Write a one-line program that makes Python calculate and display 15 plus 27 — using the
+operator, not by typing the answer. Run it; write down what it printed. - Strings vs. numbers. Write two lines: one that prints
7 + 2as arithmetic (so Python shows the sum) and one that prints7 + 2as text (so Python shows it literally). Run both and notice the difference.
Part 4 — (b) Trace: Predict, Then Run
For each program below, first write your predicted output in the table (don't run it yet!). Then run each one in the editor and fill in the "Actual" column. Where your prediction and the actual output differ, that's the lesson.
| # | Program | Your prediction | Actual (after running) |
|---|---|---|---|
| 1 | print(3 + 4) |
______ | ______ |
| 2 | print(3 * 4) |
______ | ______ |
| 3 | print("3" + "4") |
______ | ______ |
| 4 | print(2 + 3 * 4) |
______ | ______ |
| 5 | print("hi", "there") |
______ | ______ |
| 6 | print(10 / 2) |
______ | ______ |
Hint for #6: look carefully at what kind of number Python prints when you divide. It might surprise you.
Visualize one: paste program #4 (print(2 + 3 * 4)) into Python Tutor and step through it. Notice the order Python evaluates the expression.
Part 5 — (c) Find & Fix the Bug
Each program below is broken. For each one: run it, read the error (bottom line first!), then write (i) the error type, (ii) why it happened, and (iii) the fixed program.
Bug A
print(Hello)
Bug B
print("Hi"
Part 6 — Analysis Questions
Answer in a sentence or two each:
1. In the trace table, which prediction did you get wrong (if any)? What did you learn from the gap?
2. Program #3 (print("3" + "4")) and program #1 (print(3 + 4)) use the same + but give different results. Why?
3. Program #6 (print(10 / 2)) printed a number with a .0 on it. What does that tell you about how Python treats division?
4. For Bug A and Bug B, the two errors had different types. In your own words, what's the difference between a SyntaxError and a NameError?
5. Connect it: how is "the computer does exactly what you wrote, not what you meant" visible in both of this week's bugs?
Part 7 — AI-Critique Moment (required — this is the BYOAI step)
Now bring in your approved chatbot (Gemini, Claude, or ChatGPT) and be the programmer who checks its work.
- Paste this to the chatbot: "What will this Python program print?
print(2 + 3 * 4)and alsoprint(10 / 2)andprint('3' + '4'). Give me the exact output of each." - Check every claim by running each program yourself in the editor:
- Did it get the precedence one right (14, not20)?
- Did it sayprint(10 / 2)prints5— or the correct5.0? (Chatbots often drop the.0and say5.)
- Did it get"3" + "4"as34(string join) — or wrongly say7? - Write 2–3 sentences reporting what the AI got right and at least one thing you had to correct or verify carefully. If it happened to get everything right, say how you confirmed each one by running it — that's the skill.
The habit all term: the tool drafts, you run it and judge. A chatbot will confidently predict the wrong output — catching it by running the code is the entire point of this course.
Part 8 — What to Submit
Submit a single document (or text entry) with: your Part 3 programs and their outputs; your completed Part 4 trace table (both columns); your Part 5 bug answers (error type, why, and the fix for each); your Part 6 answers; and your Part 7 AI-critique paragraph. Due Sunday, Sep 6, 11:59 p.m. (50 points).
Instructor answer key & model outputs — REMOVE BEFORE PUBLISHING TO STUDENTS
Execution gate: PASS — every output below was produced by actually running the code in Python. Students' Part 3 wording varies; grade those on "does it run and produce the right kind of output."
Part 3 (model):
1. Two print lines, e.g. print("Sam") / print("learn to build a game") → two lines. ✓ (exact words vary)
2. print(15 + 27) → 42 (must use +, not type 42). ✓
3. Arithmetic: print(7 + 2) → 9; as text: print("7 + 2") → 7 + 2. ✓
Part 4 trace table (run-verified):
| # | Program | Actual output |
|---|---|---|
| 1 | print(3 + 4) |
7 |
| 2 | print(3 * 4) |
12 |
| 3 | print("3" + "4") |
34 |
| 4 | print(2 + 3 * 4) |
14 |
| 5 | print("hi", "there") |
hi there |
| 6 | print(10 / 2) |
5.0 |
Part 5 bugs (run-verified):
- Bug A print(Hello) → (i) NameError (name 'Hello' is not defined); (ii) the quotes are missing, so Python reads Hello as a name it doesn't know; (iii) fix: print("Hello") → Hello.
- Bug B print("Hi" → (i) SyntaxError ('(' was never closed); (ii) the closing parenthesis is missing, breaking Python's grammar, so it won't run; (iii) fix: print("Hi") → Hi.
Part 6 (expected): (1) most commonly #4 (14, not 20) or #6 (5.0, not 5). (2) With numbers, + adds (3 + 4 = 7); with strings, + joins the text ("3" + "4" = "34") — the quotes change the meaning. (3) The / operator always produces a float in Python, so 10 / 2 is 5.0, not 5. (4) A SyntaxError means the code's grammar is broken (Python won't run any of it); a NameError means the grammar is fine but a name is unknown. (5) In both bugs Python did exactly what was written — looked up a name that didn't exist, or refused an ungrammatical line — rather than guessing the intended print("Hello") / print("Hi").
Part 7 (AI-critique): full credit for a specific catch — most commonly the AI saying print(10 / 2) prints 5 instead of 5.0, or mis-tracing "3" + "4". Full credit also if the student verified each AI claim by running it.
Grading rubric — 50 points
| Criterion | Full | Partial | None |
|---|---|---|---|
Part 3 — wrote & ran 3 programs (code + output shown; #2 uses +, #3 shows string vs. number) (14) |
14 | 7–11 | 0–5 |
| Part 4 — trace table (predictions attempted + all 6 actual outputs correct from running) (14) | 14 | 7–11 | 0–5 |
| Part 5 — found & fixed both bugs (error type + why + fix for each) (12) | 12 | 6–10 | 0–4 |
Part 6 — analysis (string-vs-number, the 5.0 float point, SyntaxError vs NameError) (6) |
6 | 3–5 | 0–2 |
| Part 7 — AI-critique (names a specific thing checked/corrected by running) (4) | 4 | 2 | 0–1 |
Quality gate (self-checked): every model output above (42, 9, 7 + 2, 7, 12, 34, 14, hi there, 5.0, Hello, Hi) and both error types (NameError, SyntaxError) were produced by actually running the code in Python — execution gate: PASS. No output is hand-traced. The lab grades the student's process (write → run → trace → debug), not a single fixed wording for the open-ended Part 3.
~ Prof. Okafor's edition · Fall 2026 · built with thecoursemaker.com