0% found this document useful (0 votes)
42 views

Python Notes

The document discusses various programming techniques in Python including using an algorithmic approach, problem solving processes, and data structures. It also covers pseudo code, flowcharts, and the software development life cycle. Pseudo code uses plain English to describe algorithms without syntax while flowcharts use graphical symbols to represent algorithms. The software development life cycle is a structured process for developing high-quality software efficiently.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

Python Notes

The document discusses various programming techniques in Python including using an algorithmic approach, problem solving processes, and data structures. It also covers pseudo code, flowcharts, and the software development life cycle. Pseudo code uses plain English to describe algorithms without syntax while flowcharts use graphical symbols to represent algorithms. The software development life cycle is a structured process for developing high-quality software efficiently.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Programming Techniques - Python

• Use of problem solving process

• Use algorithmic approach to solve problems

• Compares and contrast different programming paradigms

• Uses data structure in program

• Manage data in database

ALPINE SKI HOUSE 1


Computer programming

• Computer Programming is defined as the process of creating computer software


using a programming Language. Computer programs are written by Human
individuals(Programmers)
• A computer program is a step by step set of instructions that a computer has to
work through in a logical sequence in order to carry out a particular task. The
computer executes these instructions (obeys the instructions) when told to do so
by the user.

ALPINE SKI HOUSE 2


Pseudo Code

Pseudo code is simply an implementation of an algorithm in the form of annotations


and informative text written in plain English. It has no syntax like any of the
programming language and thus can’t be compiled or interpreted by the computer.

Example 1: Write pseudo code that reads two numbers and multiplies them together and print out
their product.
Read num1 , num2
Set multi to num1*num2
Write multi

ALPINE SKI HOUSE 3


Pseudo Code

Example 2: Write pseudo code that tells a user that the number they entered is not a 5 or a 6.

Read isfive
If(isfive = 5)
Write "your number is 5"
Else if (isfive = 6)
Write "your number is 6"
Else
Write "your number is not 5 or 6"

ALPINE SKI HOUSE 4


Pseudo Code

Example 2: Write pseudo code that performs the following: Ask a user to enter a number. If the number is between 0 and 10,
write the word blue. If the number is between 10 and 20, write the word red. if the number is between 20 and 30, write the
word green. If it is any other number, write that it is not a correct color option.
Write "Please enter a number"
Read colornum
If (colornum >0 and colornum <= 10)
Write blue
else If (colornum >10 and colornum <= 20)
Write red
else If (colornum >20 and colornum <= 30)
Write green
else
Write "not a correct color option"

ALPINE SKI HOUSE 5


Pseudo Code

Advantages of Pseudocode
• Improves the readability of any approach. It’s one of the best approaches to start implementation
of an algorithm.
• Acts as a bridge between the program and the algorithm or flowchart. Also works as a rough
documentation, so the program of one developer can be understood easily when a pseudo code is
written out. In industries, the approach of documentation is essential. And that’s where a pseudo-
code proves vital.
• The main goal of a pseudo code is to explain what exactly each line of a program should do, hence
making the code construction phase easier for the programmer.

ALPINE SKI HOUSE 6


Flow Charts

• Flowchart is a graphical representation of an algorithm. Programmers often use it


as a program-planning tool to solve a problem. It makes use of symbols which are
connected among them to indicate the flow of information and processing.

ALPINE SKI HOUSE 7


Basic Symbols Used in Flowchart Designs

- Start / Stop

- Input/ Output

- Process

- Decision

- Control Flow

- Connector

ALPINE SKI HOUSE 8


Flowchart Rules

• Flowchart is generally drawn from top to bottom


• All boxes of flowchart must be connected with arrow
• All flowchart start with a terminal or process symbol
• Decision symbol have 2 exit points, one for YES (TRUE) and another for NO (FALSE)

ALPINE SKI HOUSE 9


Exercise 01 : - Add 10 and 20

Algorithm
1.Initialize sum = 0 (process)
2.Enter the numbers (I/O)
3.Add the numbers and store
the result in sum (process)
4.Print sum (I/O)

ALPINE SKI HOUSE 10


Flowchart Structures

1) Sequence
2) Selection
3) Repetition

ALPINE SKI HOUSE 11


Sequence

ALPINE SKI HOUSE 12


Selection (Decision)

ALPINE SKI HOUSE 13


Repetition (Loop)

ALPINE SKI HOUSE 14


Flowchart Structures

pseudo-code for a simple program that calculates the total amount payable when
you include the hourly and hourly rate

Begin
input hours
input rate
pay=hours*rate
print pay
End

ALPINE SKI HOUSE 15


Software Development Life Cycle (SDLC)

ALPINE SKI HOUSE 16


Software Development Life Cycle (SDLC)

• The Software Development Life Cycle (SDLC) is a structured process that enables
the production of high-quality, low-cost software, in the shortest possible
production time.
• The goal of the SDLC is to produce superior software that meets and exceeds all
customer expectations and demands.
• It consists of a detailed plan describing how to develop, maintain, replace and alter
or enhance specific software. The life cycle defines a methodology for improving
the quality of software and the overall development process.

ALPINE SKI HOUSE 17

You might also like