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
[Link]() – Display text or values on the First
screen
[Link]() – Accept input from the user
[Link] assignment – x = 10
[Link] data types – int, float, str, bool
[Link] operations – +, -, *, /, %
[Link] operators – ==, !=, >, <,
>=, <=
[Link] operators – and, or, not
[Link], elif, else – Decision-making
[Link], while loops – Repeating actions
10.# – Add comments to your code