Case Analysis of selective structure in Python
In this article, the editor introduces in detail the "case analysis of the selected structure in Python". The content is detailed, the steps are clear, and the details are handled properly. I hope that this article "case analysis of the selected structure in Python" can help you solve your doubts.
1. The selection structure determines the execution of the branch by judging whether the condition is established or not.
2. Choose the structural form: single branch, double branch and multi-branch.
3. Multi-branch structure, there is a logical relationship between several branches, and the order can not be reversed at will.
Example
'' single branch selection structure if conditional expression: sentence / statement block''if 3 branch selection structure if conditional expression: statement / statement block else statement / statement block''a = 3 if a