Conditional judgment statements are a must-have basis for Python programming language learning, and many people feel that they can't remember grammar, and the old boy it education gives you a summary of the relevant language:
I. How to use the IF statement
(1) Use of If...else
If...else is a single conditional judgment statement in an IF condition statement, which uses the following:
If judging condition:
Execute statement ...
Else
Execute statement ...
(2) Use of If...elif...else
If...elif...else is a multiple conditional judgment statement in an IF condition statement, with the following usage:
If judgment condition 1:
Execute Statement 1 ...
Elif Judgment Condition 2:
Execute Statement 2 ...
Elif Judgment Condition 3:
Execute Statement 3 ...
Else
Execute Statement 4 ...
and C language, the Python programming language does not support the switch statement, so multiple criteria can only be used to determine the elif, if the judgment needs to be judged by multiple conditions, the use of or (or), indicating that two conditions have a set up to determine the conditions for success; Indicates that only two conditions have been established at the same time, the judgment condition succeeds.
If you would like to learn more about Python, it is recommended to take a look at the curriculum of older boys ' education, which has been developed since 2012, and currently has 0 basic full-time Python full-stack development and on-the-job operations, testing, Front-end development and other friends can learn the Python Automation Development weekend class course. Now python full stack development began to implement the "dual-track 5+5" Learning model, the course included in the curriculum of Artificial intelligence (image recognition, unmanned aerial vehicles, unmanned aerial vehicles, etc.) and the relevant knowledge of the go language, in order to expand the field of knowledge.
More details: Old boy It education: www.oldboyedu.com
Python related knowledge exchange please contact me, tel: 18500150262,qq:1984390366
Python Conditional Statement Instance code