decision making in python

 

04. DECISION MAKING IN PYTHON

 

v Decision making statement: - A statement which is used to making the decision is known as decision making statement.

 

v Conditional statement: - A statement is used to creating a condition in a program is known as conditional statement.

 

àThere are three types of conditional statement:-

i.        If … statement.

ii.        If ……..else statement.

iii.        If ……elif……else statement.

 

 

 

v If… statement: - It is a conditional statement.

àIt is also known as simple if statement.

àIt is used to create a single condition in a program.

 


FLOWCHART

 


Flowchart: Decision: Test Expression

True Block Statement (S)

 
                                                                                    False                                                                                        

 

      True

 

 

 

v If…else statement: - It is a conditional statement.

àIt is also known as double selection statement.

àIt is used to create double condition in a program.

FLOWCHART

Flowchart: Decision: False Block Statement (S)
Flowchart: Decision: Test Expression
 


True Block Statement (S)

 
                                                                                                               False

                                                                                True                                                                   


If….elif….else statement: - It is a conditional statement.

It is used to create more than two decisions in a program.

 

 

FLOWCHART

Flowchart: Decision: Test condition 1?

Statement 1

 
 


                                                                   True

Statement 2

 

Statement (X)

 
Flowchart: Decision: Test condition                                                                                2?                    False                  

v Branching: - Branching means two or more statement within another statement.

àIn python there are following branching statement: -

i.        If…. Statement.

ii.        If.… Else Statement.

iii.        If…. Elif…. Statement.

iv.        Nested…. If…. Else Statement.

 

Comments

Popular posts from this blog

HTML

Administration of the Internet

FUNDAMENTAL OF COMPUTER