 I am Nawal Emul working as the assistant professor in mechanical engineering department waltz and institute of technology solapur in this video we are going to see the python programs with decision making statements learning outcomes at the end of this session students will be able to write a program using decision making statements on python content of this video is introduction then we are going to see what is if statements and programs using if statement if else statement and program using if else nested if and programs using nested if then I live statement and programs using I live statement introduction here comes a situation in real life when we need to make some decisions and based on this decisions we decide what should we do next similar situation arises in programming also where we need to make some decisions and based on this this decisions we will execute the next block of code decision making statements in programming language decides the direction of flow of program execution decision making statements available in python are so first we will see what is if statement if statement is the most simple decision making statement it is used to decide whether a certain statement of block of statements will be executed or not that is if a certain condition is true then the block of statement is executed otherwise it is not executed statement if so we use condition after condition we use colon then statements to execute if condition is true so we will see a flowchart of if statement so here you can see there is a text test expression if it is true it goes inside the body of if if it is false it goes outside the body or it does not enter the body of if then statement just below if whatever is the statement below if it executes there so if it is true it goes inside the body of if otherwise it go outside so figure one shows the flowchart of if statement so we will see a simple programs using if statement so write a simple program to find if number 10 is less than 15 so it is very simple i equal to 10 if i am giving a condition if i is greater than 15 then colon here semicolon print 10 is less than 15 if this is true it goes inside the body of if otherwise it goes directly outside here 10 is not greater than 15 so it is false it goes directly here it will print i am not in f so the output for the statement would be i am not in f write a program to find the largest number using if statement a is 33 b is 200 if b is greater than a here 200 is greater than 33 then it goes that is true that goes inside the body of if and it will execute b is greater than a so your output would be b is greater than a so write a program to find the number is even or odd so here i am taking a variable num in in the form of data type integer input enter a number so if the condition would be num modulus 2 that is used for the reminder if we divide this with 2 and if the remainder is equal to equal to 0 we have seen all these operators in second video and third video please go through the second and third video then if the statement is true then it will print the number is even if the statement is false it does not print number is even so enter a number if the user enters number 10 so 10 mod of 2 the remainder would be 0 then it will print number is even so next is if statement the if statement alone tells us if the condition is true it will execute a block of statement and if the condition is false it won't but what if we want to do something else if the condition is false so if the condition is false we need to execute some other statements for that purpose we use if l statements we can use the l statement with if statement to execute a block of code when the condition is false so we will see the syntax if we put a condition then colon executes this block if condition is true if condition is false then it goes inside the else body then it executes the else block so we will see the flowchart of the if l statement so your test expression if it is true it goes inside the body of if if it is false it goes inside the body of else and the statement just below if is executed so this is figure flow figure to flowchart of if l statement so we will see a few programs on if l statement so write a program to check whether a given number is even or odd using if l statement and I am taking a variable x input enter a number so the condition would be x mod of 2 whatever the user enters and if I divide with 2 and if the remainder is 0 then I that the condition would be true and it would execute the x is even number if the statement would be false that is if x mod 2 the remainder is not 0 then it prints x is odd number so here input sorry output enter a number 5 it shows x is a odd number so we will see next program to check the largest number among 2 so I have taken two variables x and y then if x is greater than y print x is greater than y else if this condition is false then it goes inside the block of else and it will print y is greater than x so here 5 and 7 where x is 5 and y is 7 it checks this condition here 5 is greater than 7 that is false then it executes the else that is y is greater than x so next we will see to check whether a person is eligible to vote or not again a very simple program so if the age is greater than 18 then it should print you are eligible for voting else you are not eligible for voting so the condition would be age is greater than or equal to 18 then the condition would be true or else it may be false if the user enters the age as 90 you are eligible to vote so you get you are eligible for voting nested if statement a nested if is an if statement that is targeted to another if statement nested if statement means and if statement inside another if statement yes python allows us to nest if statements within if statements that is we can place an if statement inside another if statement so we will see a syntax so condition number one if it true it executes here if you have more than two conditions we use nested if if condition number two it executes if this statement is true then this if statement ends here and this if statements block is ended here so we understand more detail in flowchart of nested if so here the text expression if it is false it goes to the body of else if it is true then nested text expression is checked here there may be two condition that is true and false if it is true it executes or it goes inside the body of nested if and if it is false it goes to the body of nested if nested else then the next statement or the statement below if is executed so write a program to check a given number is positive or negative so I have taken n as a variable if I will check n is greater than 0 print positive else if I have one more condition that is n is less than 0 print negative else print 0 so here if inside if there is one more if statement so we call this as nested if example so here if I enter the number 6 it shows positive and if I enter a minus 7 it shows negative write a program to check the number of digits entered by the user so here nested if again so you can see the indentation over here if n is less than 10 print you entered one digit else so I have one more condition if user enters the digits from 11 to or 10 to 100 or 99 then it should print you enter two digits else if n is less than thousand that is if user enters till triple nine you entered three digit number and apart from that if user enters any of the number more than three digits then it should and show you have entered three digit number so if the user enters 5 the output would be so if this statement is true it shows you entered one digit if the user enters 15 it will come to this second block and it checks the condition and it will print you entered two digit number so these are the references I have used thank you