iNTERFACEWARE Products Manual > Learning Center > Learning Python > Conditional Statements and Loops > The else Statement |
|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
You can use the else statement to specify code to be executed if none of the conditions specified by the if and elif statements are true:
Here, Python checks whether patientid is 42113, then checks whether patientid is 42007. If neither of these is true, the statements after the else are executed. The statements included with the else condition must be indented, and the else statement must appear after the if statement and after any elif statements.
|