You can use the elif statement to specify another condition to try when the condition
specified by an if statement is not true. (elif is short for "else if".) For example:
patientid = 42007
if patientid == 42113:
print"The patient ID is 42113"elif patientid == 42007:
print"The patient ID is 42007"
In this example, Python first checks whether patientid is equal to 42113. Since it is not, Python then checks whether patientid
is equal to 42007, which it is.
The elif statement uses the same comparison operators as the if
statement. The statements included with the elif condition must be indented.
You can include as many elif statements as you want.