Mental Model of Programs
1 / 15

A Program is a Scroll of Sequential Instructions

"A program is fundamentally a conversation in precise language—a scroll of instructions that the computer reads and executes strictly from top to bottom."

Sequential Execution

Computers read and execute your code the way you read a page: line by line, from top to bottom. Each instruction finishes completely before the next line begins.

Mental Model: Think of a program as a kitchen recipe or spell scroll. Each step happens in exact order—you can't butter warm toast before you put the bread in the toaster!

Watch Instructions Execute Line-by-Line

1. bread = get_slice("sourdough")
2. toaster.insert(bread)
3. toaster.toast(seconds=120)
4. warm_toast = toaster.pop_up()
5. spread_butter(warm_toast)
Stage: [ Raw Loaf ] → → → →
⏸Ready at Line 0 — Press "Execute Next Line" to step through the program!
DEEP DIVE The Translation Process: From Human Thought to Python Code + Explore

Programming is translating your human intentions into small steps the computer understands. Never start by staring at a blank screen worrying about punctuation—start by listing what needs to happen in plain English, then translate each line into code.

"Don't start with syntax. Start with: 'What steps does this problem need?' Write them in plain English first. Then translate each step to Python."

Step-by-Step Translation

Human thought: "I want golden buttered toast."

  1. Fetch a slice of bread
  2. Place the bread inside the toaster
  3. Set the timer to 120 seconds and start toasting
  4. Pop up the warm toast when done
  5. Spread butter across the warm toast
bread = get_slice("sourdough")
toaster.insert(bread)
toaster.toast(seconds=120)
warm_toast = toaster.pop_up()
spread_butter(warm_toast)
Golden Tulips
Card 1 Takeaway (Golden Tulips Unlocked!): Notice how each line of code performs one clear action in order. When you break a big problem into a sequence of small, one-line steps, your code almost writes itself!
Think of a program as a scroll read strictly from top to bottom. Order is the first law of code.
Wizard Guide