Introduction to Python

Flowchart and Symbols

Lesson 3: Algorithms

What is a Flowchart?

A flowchart is a visual diagram that represents an algorithm using shapes and arrows. It shows the flow of steps and decisions in a program, making it easy to understand the logic before writing any code.

Flowcharts are a universal tool used by programmers, engineers, and business analysts to visualize processes and logic before implementation.

Flowchart Symbols

Standard Flowchart Symbols

A rounded rectangle oval shape labeled Terminal representing the start or end of a flowchart
Terminal (Start/End)
A rectangle shape labeled Process representing an action or calculation step
Process
A diamond shape labeled Decision with Yes and No branches coming out of it
Decision
A parallelogram shape labeled Input or Output representing data entering or leaving the program
Input / Output

Standard Flowchart Symbols

SymbolShapeMeaning
TerminalRounded rectangle (oval)Marks the Start or End of the flowchart
ProcessRectangleRepresents an action or instruction (e.g. calculate, assign)
DecisionDiamondRepresents a yes/no or true/false question
Input/OutputParallelogramRepresents data input (e.g. user types) or output (e.g. display result)
Arrow/Flow LineArrowShows the direction of flow between steps

Example: Flowchart for Checking a Number

Let's draw a flowchart for a program that checks whether a number entered by the user is positive, negative, or zero.

Flowchart diagram showing the logic for checking whether a number is positive, negative, or zero with decision diamonds and process rectangles

Flowchart to Python Code

Once a flowchart is ready, translating it to Python code becomes straightforward. Each flowchart symbol maps directly to a Python construct:

Flowchart to Python Mapping

Flowchart SymbolPython Equivalent
Terminal (Start/End)Beginning or end of the script
Input/Outputinput() or print()
ProcessVariable assignment or calculation
Decisionif / elif / else statement
Side by side view of a simple flowchart on the left and its equivalent Python code on the right with colored arrows connecting each symbol to its corresponding code line
Always draw a flowchart before writing complex programs. It saves time and helps you spot logical errors before they become code bugs!

Subscribe to our newsletter.

Get updates to news and events.