Decision Making Statements In Python Programming Language

Decision Making In Python Programming Language

In this lesson, we will learn all about decision making in Python. By decision making it means we set some kind of logical conditions in our code to be executed and only when these conditions fulfill the program will take specified action otherwise it didn’t work.

These decision making statements normally provides results in the form of TRUE or FALSE according to the conditions we had specified before. You also need to specify which action should be performed in case of result to be TRUE or FALSE.

Recommended:  Comments, Indentation and Statement In Python Programming Language

We can represent these decision statements in graphical form as follows and these graphical working model almost the same in every programming language.

As you can see above the very first thing is condition specified by us. Based on our specified condition the result will be TRUE or FALSE and after this, appropriate action will be performed accordingly. After all this cycle the statement will be terminated.

Recommended:  Python Nested if Statements With Example

Any value that is non-zero or non-null will be considered as TRUE or positive value by Python programming language for his operations and on the other hand, any zero or null value will be considered as FALSE or negative value by Python programming language.

Like any programming language in Python programming language also provides the following decision making statements to complete their operation based on given conditions. All the decision making statements are given below with a complete explanation. Just click the links below to learn about all these statements.

Recommended:  Keywords And Identifiers In Python Programming Language
Sr. No.Decision Making Statement
1. if statement
This statement is based on one boolean expression which can be True or False.
2.if.elif..else statements
This kind of if statement have an optional additional part as else. It will only execute when the boolean expression is False.
3.nested if statements
This is a kind of statement in which you can use one if or else statement inside of another if or else statement.

Jack Sparrow

Hay I am Admin Of This Website. I am very passionate about Computers and technology. This website is the result of my passion. I love to eliminate the barriers comes in the for seeking education. This website is the free source of learning about new technology and up to date knowledge.

Leave a Reply

Close Menu