Algorithm &
Program
What is an Algorithm?
• Definition: An algorithm is a step-by-step set of instructions
to solve a problem or perform a task.
Example: Algorithm to make tea:
• Boil water
• Add tea leaves
• Add sugar and milk
• Boil again
• Filter and serve
• Key Idea: Algorithms are language-independent and can be
written in plain English.
Features of an Algorithm
• Clear and unambiguous steps
• Has a definite start and end
• Takes input and produces output
• Should be effective (workable)
What is a Program?
Definition: A program is a set of instructions written in a
programming language (like Python) that a computer can
execute.
• Purpose: To automate tasks using logic written as
code.
From Algorithm to Program
Example: Adding Two Numbers
Algorithm:
• Start
• Get two numbers
• Add them
• Display the result
• Stop
Differences at a Glance
Algorithm Program
Language-free Written in code
Step-by-step logic Executable instructions
Easy to understand Requires programming skills
Summary
• Algorithm = plan or method
• Program = implementation of the plan in code
• Both are essential for solving problems using computers
Basic Python Commands to Learn
1.print() – Display text or values on the First
screen
2.input() – Accept input from the user
3.Variable assignment – x = 10
4.Basic data types – int, float, str, bool
5.Arithmetic operations – +, -, *, /, %
6.Comparison operators – ==, !=, >, <,
>=, <=
7.Logical operators – and, or, not
8.if, elif, else – Decision-making
9.for, while loops – Repeating actions
10.# – Add comments to your code