first code-reading lab
this is not a variables chapter for future Python programmers. it is your first lab for reading tiny AI-generated scripts: spot the names, run the output, and understand enough to change one thing safely.
Why code appears here at all
You are not learning variables because PromptDojo secretly wants to become a Python course.
You are learning this because AI tools will hand you small scripts, formulas, workflows, and snippets. If you cannot read the first five lines, you cannot stay in charge of the tool you asked for.
So this chapter is a code-reading lab. The goal is not “be good at Python.” The goal is: when AI gives you a tiny program, you can run it, point at the important names, and change one value without breaking the whole thing.
The tiny mental model
A program needs names for things.
limit = 10
used = 7
remaining = limit - used
Read that like a note, not like math class:
limitis the number the tool is allowed to useusedis what already happenedremainingis the answer after subtracting one from the other
That is enough to begin. A variable is just a name stuck to a value so the program can reuse it later.
What this chapter covers
Lesson 1: Naming things you can point at. You learn to see the names in a tiny script and ask: what value does this name point to right now?
Lesson 2: Values come in shapes. Some values are numbers, some are text, some are true/false answers. You do not memorize type theory; you learn the few differences that make AI-generated code fail.
Lesson 3: Simple outputs. You make the script say what happened in a sentence. This is the first useful move in many small tools: take structured information and turn it into a readable result.
What you will be able to do at the end
By the end you will be able to:
- run a tiny AI-generated script and explain the output
- identify the names the script uses
- tell the difference between a number, text, and true/false value
- edit one safe value and predict what changes
- read the next chapter without feeling like code is a wall
This is still the builder loop. The tool is just starting to have moving parts.