Python Decision Making | How To Use If Else Statement?

Python Decision Making With Example And How to Use If, If Else Statement

In our programming journey , the python decision making will be use from the beginning to the end. When you start developing your project you need to make a specific criteria decision based on a condition. In this chapter what we will discussing in this python decision making lesson and I will teach you how to use if statement, if-else and nested statement in decision making with the simple and starter examples.

Python Decision Making

There are some points come in your life where you need to decide and take some step and make future decision.

In programming language you need in module , class and events make a decision on criteria. You used decision making when you use the multiple statement and execute single statement with specific criteria.

Let’s here we explain this with a simple example. Suppose, you are developing a project  related to school management system . and writing a program student result. So in every step you need make decision. You can declare your decision with if statement, if-else statement and nested statement like this.

PYTHON DESICION MAKING

In above example I collect some student result data and get grade by using decision making with if-else statement.

Python Decision Making Use If-Else Statement

python decision making

eng= int(60)
math= int(70)
urdu= int(80)
tot_markas = (eng + math + urdu)
if tot_markas > 200:
print(“Obtain Marks Is : 300”)
print(“Obtain Marks Is :”, tot_markas)
print(“Your Grade Is : A”)
elif tot_markas <= 200:
print(“Obtain Marks Is : 300”)
print(“Obtain Marks Is :”, tot_markas)
print(“Your Grade Is : B”)

This Post Has 5 Comments

  1. site

    Quality articles is the secret to be a focus for the visitors to pay a visit the
    web site, that’s what this site
    is providing.

  2. Dominick

    I think the admin of this web site is actually working hard in favor of his web page,
    as
    here every data is quality based data.

Leave a Reply