2. WHAT IS PYTHON
PROGRAMMING
LANGUAGE?
• A programming language is a set of rules for communicating an algorithm.
• A program language is a notational system for describing computation in a
machine readable and a human readable form.
• Python is a high level programming language certain examples of high level
language are C++, Perl, Java ,etc
• Python that are written in high level language is required to be processed before
they can run..
4. ROLE OF PROGRAMMING LANGUAGE:-
• Getting the answer
• Correctness
• Preciseness
• Efficiency
• User friendly ness
CHARACTERISTICS OF A GOOD
PROGRAMMING LANGUAGE:-
• Clarity , simplicity and unity
• Orthogonality.
• Ease of program verification
• Programming environment
• Portability of program
5. ALGORITHM
• An algorithm is formally define procedure for performing some
calculations
• The algorithm gives the logic of the program that is step by step
description of how to arrived to a solution
• There are two approaches for designing an algorithm
Algorithm
Top down approach Bottom up approach
Example of top down approach is factorial of any no.
Example of bottom up approach is substitution method.
6. CONTROL STRUCTURES USED IN
ALGORITHMS
1. Sequence:- Sequence means each step of algorithm is executed in the specified order.
For eg. Algorithm to add two numbers
Step 1: Input no. 1 as A
Step 2: Input no. 2 as B
Step 3: Set Sum = A+B
Step 4: Print Sum
Step 5: End
2. Decision:- Decision statements are used when the outcomes of the process depends on some
conditions.
For eg. Find the no. is equql or not
Step1: Input no.1 as A
Step2: Input no. as B
Step3: If A=B
Print”EQUAL”
Else
Print”not equal”
7. 3. Repetition
Repetition means which involves executing one or more steps for a number of times.
For example, Algorithm to print 1-10 natural numbers.
Step 1: START
Step 2: Set I=1, N=10
Step 3: Repeat steps 3 and 4 while I<=N
Step 4: Print I=1
Step 5: Set I=I+1[End of loop]
Step 6: END