There is only one judgment statement in Python, which is if. else..
There are three common types of these:
1. Only if, no else
If judging condition:
EXECUTE statement
2. If there is another else
If judging condition:
EXECUTE statement
Else
EXECUTE statement
3. Both if and elif, and else
If judging condition:
EXECUTE statement
Elif Judging conditions:
EXECUTE statement
Elif Judging conditions:
:
:
Else
EXECUTE statement
Since Python does not support switch statements, multiple conditions can only be determined by elif, and if the judgment requires multiple conditions to be judged at the same time, the or (or) is used to indicate that two conditions have a successful condition when they are established; When using and (and), Indicates that only two conditions have been established at the same time, the judgment condition succeeds.
Python Judgment statement