To put it together:
elif-else
clause combination is entered when a certain condition in the initial statement-clause construct is NOT satisfied.
These conditions are different for different cases: if
, while & for
and try-except
.
if
:elif-else
is entered if condition inif condition
is NOT satisfiedwhile & for
:elif-else
is entered if NObreak
was executed in the loop bodytry-except
:elif-else
is entered if NO exceptions were raised in thetry
body