Fork it: if/else
The if-else
progression looks like this. If the predicate evaluates
to True
the block TRUE_CODE
executes.
Otherwise, the block FALSE_CODE
executes. Something
is guaranteed to happen. This is a two-tined fork.
if predicate:
TRUE_CODE
else:
FALSE_CODE
Having a good tine with if/else/elif
You can have as many tines as you want with this construct.
if predicate1:
CODE_1
elif predicate2:
CODE_2
.
.
.
elif predicateN:
CODE_N
else:
CODE_DEFAULT