First, the difference between python2x and python3x
1, python2x source clutter, high repetition rate, python3x source code beautiful concise and clear.
2, python2x default use Unicode encoding, only support English numeric special characters; python3x default UTF-8 encoding, support Chinese.
Second, operator
1, judge the following logical statements True,false.
1) 1 > 1 or 3 < 4 or 4 > 5 and 2 > 1 and 9 > 8 or 7 < 6
2) not 2 > 1 and 3 < 4 or 4 > 5 and 2 > 1 and 9 > 8 or 7 < 6
2. Find the values of the following logical statements.
1), 8 or 3 and 4 or 2 and 0 or 9 and 7
2), 0 or 2 and 3 and 4 or 6 and 0 or 3
3. What are the following results?
1), 6 or 2 > 1
2), 3 or 2 > 1
3), 0 or 5 < 4
4), 5 < 4 or 3
5), 2 > 1 or 6
6), 3 and 2 > 1
7), 0 and 3 > 1
8), 2 > 1 and 3
9), 3 > 1 and 0
10), 3 > 1 and 2 or 2 < 3 and 3 and 4 or 3 > 2
Basis of Judgment: (1) Priority of operation: Not>and>or
(2) for or, if one side is 0, the result is the other; if there is no 0, the left side. For and, if one side is 0, then O, or to the right if there is no 0.
Python Face question Collection