appendix python review nested if statements there is no restriction on the type of statements that can be included within the blocks executed by the if statement sometimesit may be necessary to nest an if statement within another if statementif num num if num num smallest num elsesmallest num elseif num num smallest num elsesmallest num the if statement and its corresponding else clause must be aligned properly to produce the correct result in the following examplethe else clause must be aligned with the second if statement to produce the message "passing but marginalwhen the average grade is in the range [ if avg if avg print"failingelse print"passing but marginal if the else were aligned with the first if statementas shown belowthe message would be incorrectly printed for averages greater than or equal to if avg if avg print"failingelse print"passing but marginal multiway branching special form of the if construct can be used with selections that tests series of conditions and performs an action for the one which results in true for examplesuppose we need to determine the letter grade to be assigned for given average using the common ten-point scale this can be accomplished using series of nested if statements as shown below on the left