Before writing any Python, it helps to understand what a program really is. At heart, it is an algorithm: a clear list of steps that solves a problem.
A recipe is an algorithm
Making a sandwich is a good example. Get two slices of bread. Spread butter. Add the filling. Put the slices together. If you skip a step or do them in the wrong order, the result is not what you wanted. Computers need the same precision.
Computers are literal
A computer does exactly what the instructions say, no more and no less. If you tell it to put the filling on before the bread, it will. That is why the order and the details of each step matter.
Try it without a computer
Ask a young learner to write the steps for brushing teeth, then follow them exactly as written, doing only what the page says. Funny gaps usually appear: "You never told me to open the toothpaste!" Finding those gaps is the first lesson in debugging.
From steps to code
Once the steps are clear, writing them in Python is much easier. Each step becomes a line of code, and the computer runs them from top to bottom.
Good habits to build
- Break a big task into small steps.
- Say each step precisely.
- Test the steps in order, one at a time.
Takeaway
Thinking in steps comes before typing code, and it is a skill that helps well beyond programming.
Continue with the book
Explore the full treatment, worked examples, and exercises in Code Quest with Python.
Adapted from Code Quest with Python, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.
