Problem Solving and
Python Programming
09/25/2025
Objective
Understanding of algorithmic problem solving
Read & Write Simple Python programs
Python programs with conditional and loops
Python functions and call them
Python data structures
Input/Output with files in python
09/25/2025
How a software get developed ?
[Link]
[Link]
[Link] (Coding)
[Link]
[Link]
For Example : Mobile Banking
09/25/2025
What is program?
A program is a set of instructions written by a programmer. The
program contains detailed instructions and complete procedures for
performing the relevant tasks.
09/25/2025
What is programming ?
Programming involves creativity, analytical thinking, knowledge
in the language in which coding or the programming is done.
Steps Involved in Programming
1. Identify the problem
2. Analyzing the Problem
3. Algorithm design
4. Pseudo code conversion
5. Flowchart
6. Coding
7. Debugging
8. Testing
9. Final output
09/25/2025 10. Documentation
Algorithm
• Definition
• Example
• Characteristic of algorithm
• Qualities of an algorithm
• Representation of algorithm
• Advantages of algorithm
• Disadvantages of algorithm
09/25/2025
Problem
Algorithm
Input Computer Output
09/25/2025
Definition
Algorithm is defined as a step by step procedure for solving any
problem.
It is also a precise rule specifying how to solve a problem.
An algorithm is a sequence of finite instructions often used for
calculation and data processing.
09/25/2025
Examples:
• Algorithm for Find the area circle.
Step 1: start
Step 2: Read the value of radius r
Step 3: Calculate Area=3.14*r*r
Step 4: Print the area of the circle
Step 5: Stop
09/25/2025
Consider the sample data r=5
Area = 3.14*5*5
Area =78.5
09/25/2025
Every algorithm must have five essential
properties:
Inputs Specified: An algorithm must have zero or more inputs
Output Specified: An algorithm has one or more outputs which
specifies relations to the inputs
Definiteness: Every details of each step must be clearly specified
Effectiveness: All operation to be performed must be sufficiently
basic that they can be done exactly and in finite
length.
Finiteness: An algorithm must always terminate after a finite number
of steps
09/25/2025
Characteristic of Algorithm
• An algorithm can be defined as a sequence of definite and effective
instruction which terminates with the production of correct output
from the given input.
• An algorithm is not a computer program it is one of the basic tool in
problem solving.
• An algorithm has the following characteristic
• Algorithm has a finite number of inputs.
• Every instruction should be unambiguous (clear) and Precise.
• Ensure that the algorithm has proper termination.
• Effectiveness of each step is very important.
• The desired output must be obtained only after the algorithm terminates.
• The algorithm should be written in sequence.
09/25/2025
Qualities of an algorithm
• The different algorithm may perform the same task with different set
of instruction.
• Some algorithm is considered as the better tool to solving the problem.
• The algorithm is written in such a way that it optimizes all necessary
conditions
09/25/2025
The factors that determine the quality of
algorithm are
Accuracy : Algorithm should provide accurate result than other.
Memory : It should require minimum computer memory.
Time : The time taken to execute any program is considered as a main
quality. Lesser the time taken better than quality.
Sequence : The procedure of an algorithm must be in a sequential
form.
09/25/2025
Representation of Algorithm
Algorithm has a starting point and a final point. Between these two
points are instruction that solve the problem.
Algorithm often have steps that repeat or require decision (such as
logic or comparison).
Algorithm can be expressed in any language from natural languages
(like English. French etc) to programming languages (like Basic.
Fortran. Python. Etc..)
Algorithm is the basic for most of the programs.
Each rule in an algorithm is written in a programming language.
All these rules are collectively called a program.
09/25/2025
Advantages of algorithm
• It makes easy to understand about the solution of the given problem.
• It uses a definite procedure to solve a problem.
• It does not dependent on any programming language therefore it is very easy
to understand.
• It is written in a sequence form. So it is easy to debug.
• By using algorithm. The problem can be sub-divided into smaller piece. So
that it is easy to convert into any programming language.
09/25/2025
Disadvantages of algorithm
• Algorithm is not a computer program. It is rather a concept of how a
program should be written.
• It is time consuming an algorithm needs to be developed first which is
then converted into flow chart and then into a computer program.
• It is difficult to show branching and looping statements.
09/25/2025