Why this matters
Before you write a single line of Python, you need a plan: the exact steps to solve the problem. That plan is an algorithm, and a flowchart is the picture that makes it easy to read. Get the plan right and the code almost writes itself.
The idea
An algorithm is just an ordered list of steps. Any algorithm can be built from three control structures:
- Sequence: do steps one after another, top to bottom.
- Repetition: repeat steps while a condition holds (a loop).
- Branching: choose between paths depending on a condition.
A flowchart draws these with standard symbols: a rounded box for start/end (terminal), a parallelogram for input/output (data), a rectangle for a process, and a diamond for a conditional branch. Arrows (lines) show the order things happen.
Picture it
flowchart TD
A([Start]) --> B{Is the signal green?}
B -- Yes --> C[Proceed]
B -- No --> D[Stop]
C --> E([End])
D --> E
Worked example
Read the diamond as a question. If the signal is green you take the "Yes" arrow and
Proceed; otherwise you take the "No" arrow and Stop. Because the path splits on a
condition, this is the branching control structure, the same shape you will soon
write in Python as if ... else.
Your turn
Try the practice questions: name the control structures, match each flowchart symbol to its meaning, and sort steps into the right order.
Recap
- An algorithm is a step-by-step method; a flowchart draws it with standard symbols.
- Every algorithm is built from sequence, repetition, and branching.
- The diamond symbol means a decision, and it becomes
ifin code.