the elif is short for else if it allows us to check for multiple expressions if the condition for if is falseit checks the condition of the next elif block and so on if all the conditions are falsethe body of else is executed only one block among the several if elif else blocks is executed according to the condition the if block can have only one else block but it can have multiple elif blocks example of if elif else'''in this programwe check if the number is positive or negative or zero and display an appropriate message''num try these two variations as wellnum num - if num print ("positive number"elif num = print("zero"elseprint ("negative number"when variable num is positivepositive number is printed if num is equal to zero is printed if num is negativenegative number is printed nested if -elsewe can have if elif else statement inside another if elif else statement this is called nesting in computer programming any number of these statements can be nested inside one another indentation is the only way to figure out the level of nesting they can get confusingso they must be avoided unless necessary python nested if example '''in this programwe input number check if the number is positive or negative or zero and display