python flow control if...else

single branch

if condition_test :

do something

Double-branch if-else format

if condition_test :

do something

else :

do something

Multi-branch if-else nested format

if condition_test :

do something

elif condition_test :

do something

...

else :

do something

in

elif=else if

There can be zero or more elif statements

Take a chestnut:

Guess you like

Origin blog.csdn.net/qq_42954795/article/details/127318905