5 again judges primary determination Python

First, test, test

Decision-making, the program checks to make (to complete a test) to see if a certain condition is true.

Python completion of the test method is limited, and each test has only two possible answers: true (true) or false (false).

Complete the test and make judgments based on the results called the branch (branching). Program to determine which way the results of the test, or perform along which branch.

image

 

Block: is a line or multiple lines of code together.

Indent: is a line of code to the right a little bit.

 

Second, the indentation

Python, when writing code indentation is an essential part.

Python code block indentation will tell where to start, where to end.

Third, test symbols

==

Fourth, other types of tests

<, >, !=, >=, <=

Fifth, if the test is false

Sixth, use and

Seven, or use

Eight, the use not

 

IX Summary:

1, test and relational operators

2, and code blocks indented

3, use and end of the test and or

4, not reverse test

Guess you like

Origin www.cnblogs.com/luhouxiang/p/11334068.html