< > !!print('less'print ('greater'print('equal'figure if-then-elseif logic each condition is checked in order if the first is falsethe next is checkedand so on if one of them is truethe corresponding branch executesand the statement ends even if more than one condition is trueonly the first true branch executes nested conditionals one conditional can also be nested within another we could have written the three-branch example like thisif =yprint(' and are equal'elseif yprint(' is less than 'elseprint(' is greater than 'the outer conditional contains two branches the first branch contains simple statement the second branch contains another if statementwhich has two branches of its own those two branches are both simple statementsalthough they could have been conditional statements as well although the indentation of the statements makes the structure apparentnested conditionals become difficult to read very quickly in generalit is good idea to avoid them when you can logical operators often provide way to simplify nested conditional statements for examplewe can rewrite the following code using single conditionalif xif print(' is positive single-digit number 'the print statement is executed only if we make it past both conditionalsso we can get the same effect with the and operator