Making Decisions and Repeating Work

Recap and Feedback


In this part, your programs grew two new abilities. They started to branch with if, elif, and else, and they started to repeat with for and while. To make the loops useful, you also learned about lists — ordered collections of values that the loops walk through. The most important skill you practiced this part was probably not any particular syntax. It was edge-case thinking: looking at branching and looping code and asking what happens at the empty case, at the boundary, at the input nobody mentioned.

The AI thread continued from the previous part’s reading skill into this part’s verifying skill. Together, those two skills form the foundation that every later AI-collaboration chapter builds on. Reading tells you what a piece of code does. Verifying tells you whether what it does is what it should do — on every input it might see, not just the obvious one.

The study log also grew in a way that finally feels like a real tracker. Multiple sessions per run, branching responses, a real summary at the end. The program is still a single-run experience — everything you log vanishes when the program exits — but the shape is now recognizable as what the project will become across the rest of the course.

If this part has gone well, you should now be able to do more than copy a loop and run it. You should be able to read a loop with branching inside it, predict its behavior on several inputs (including the empty one), and recognize the patterns it is built from.

Recap Quiz

The recap quiz below is a short sequence of questions drawn from the main ideas of this part. Complete it before the feedback form.

Feedback

Next, please take a moment to reflect on your work in this part and provide feedback. Your input helps us improve the course materials.

A few questions worth thinking about as you reflect:

  1. Which chapter felt most straightforward?
  2. Which chapter still feels uncertain?
  3. When a loop did not produce what you expected, how did you investigate the problem?
  4. How did the edge-case checklist from Verifying Behavior change how you read AI-generated code, if at all?
  5. Looking at your study log now, what is the bug or edge case that worried you most while you were writing it?

Reflection and feedback

0 / 5 points

Consider the following statements and answer them based on your experiences from studying the materials and working on the assignments in this part. When answering the numeric statements, answer them so that value 1 means that you strongly disagree with the statement, and value 7 means that you strongly agree with the statement. Please be as honest as possible when answering. The feedback will be used to improve the course.

Looking Ahead

In the next part, your study log starts to feel a bit unwieldy as a single script. Several things in it could be reused — the “format a session response” logic, the “summarize a list of minutes” logic — but right now they are tangled together in one long file. The solution is functions: small, named, reusable pieces of code that each do one thing. Part 3 is about defining them, testing them, and reorganizing existing code around them.

The AI thread continues too. With reading (Part 1) and verifying (Part 2) in place, the next part’s focus is on the other side of the conversation: specifying what you want — turning intent into prompts. Vague prompts produce vague code, regardless of who or what is writing it. The act of writing a precise specification is itself a programming skill, and it is the next one you will practice.