statements optional else basic examples to demonstratelet' look at few simple examples of the if statement at work all parts are optionalexcept the initial if test and its associated statements thusin the simplest casethe other parts are omittedif print('true'true notice how the prompt changes to for continuation lines when you're typing interactively in the basic interface used herein idleyou'll simply drop down to an indented line instead (hit backspace to back upa blank line (which you can get by pressing enter twiceterminates and runs the entire statement remember that is boolean true (as we'll see laterthe word true is its equivalent)so this statement' test always succeeds to handle false resultcode the elseif not print('true'elseprint('false'false multiway branching now here' an example of more complex if statementwith all its optional parts presentx 'killer rabbitif ='roger'print("shave and haircut"elif ='bugs'print("what' up doc?"elseprint('run awayrun away!'run awayrun awaythis multiline statement extends from the if line through the block nested under the else when it' runpython executes the statements nested under the first test that is trueor the else part if all tests are false (in this examplethey arein practiceboth the elif and else parts may be omittedand there may be more than one statement nested in each section note that the words ifelifand else are associated by the fact that they line up verticallywith the same indentation if tests and syntax rules