Python Algorithm and PSEUDOCODE 

Introduction to Programming

Programming is the process of creating a set of instructions that tell a computer how to perform a task. Programming can be done using a variety of computer programming languages, such as JavaScript, Python, and C++.

Whats is Computer Programming

A computer program consists of code that is executed on a computer to perform particular tasks. This code is written by programmers.

Procedure For Problem Solving

1) Understanding the problem
2) Design the problem and make declaration
3) Write a code
4) Compile
5) Run the Problem
6) Testing and Designing the Problem
7) Maintain and modify the program

Algorithm

Step by step solution of a given problem is called algorithm.

Characteristics of Algorithm

1) It is general english language writen in steps to justify the program objective can easily be understood by a beginner
2) Algorithm steps and the input/output should be clear.
3) It is no more program code
4) No standard format or syntax required.
5) Program control is always in from Top-to-bottom.
6) It is independent of programming languuage.



Algo-1 Write an algorithm for addition of two number.

Step-1 START
Step-2 Read a,b
Step-3 c=a+b
Step-4 Print c
Step-5 Stop

Algo-2 Write an algorithm for simple interest.

Step-1 START
Step-2 Read P,R,T
Step-3 SI=P*R*T/100
Step-4 Print SI
Step-5 Stop

Algo-3 Write an Algorithm to find area of circle

Step-1 START
Step-2 Read r
Step-3 area=3.14*r*r
Step-4 Print area
Step-5 Stop

4) Write an Algorithm to find volumn of cylinder and cone

Step-1- START
Step-2- Read r1,r2,h1,h2
Step-3- vol1=3.14*r1*r1*h1
Step-4- vol2=3.14*r2*r2*h2
Step-5- Print vol1
Step-6- Print vol2
Step-7- Stop/END

5) Write an Algorithm for finding greater value between two integer.

Step-1- START
Step-2- Read a,b
Step-3- check if a>b then print ‘a’ otherwise print ‘b’
Step-4- END

PSEUDOCODE 

Pseudocode is a method of planning which enables the programmer to plan with worrying about syntax. or we can say that Pseudocode is a simple way of writing programming code in English.

General rules used for writing pseudocodes are as follow:

a) Imperative Sentence-

The imperative sentences are used to show actions. For examples Add x to sum, Display result, Sort list, calculate, etc.

b) Operator- Mostly arithmatic operator (+,-,*,/ etc.) and relational operator(=,>,< etc.) are used.

c) Decision- IF,THEN,ELSE,CASE,ENDCASE are used for decision making.  The looping or repetition of statements is shown by FOR, WHILE etc.




Example 1: pseudocode to create a program to add 2 numbers together and then result

Start Program

Enter two numbers A, B

Add the numbers together

Print Sum

End Program

Example 2 : pseudocode to print if candidate can vote or not.

Start Program

Enter age

IF age>-18

THEN Display “can vote”

ELSE Display “Cannot vote”.

End Program

Complete Python For Beginners Level to Advance level click on the below link

Python Playlist

Thanks for Reading the Artical i hope you will understand the topc well.

Also Subscribe our YOUTUBE CHANNEL

https://www.youtube.com/@olevelguruji

 

mobile operating system | Desktop operating system

 

4 thoughts on “Python Algorithm and PSEUDOCODE ”

  1. I am glad i got to find your THIS site. I have been examining out a few of your articles and its pretty stuff to read. I will surely bookmark your blog to make sure I could get an up to date post. You can find more info here 🙂
    regards

    Reply

Leave a Comment