First, arithmetic operators
The arithmetic operators have the following types:
+: Addition
-: Subtraction
*: Multiplication
/: Division, which is the real division, the result shows the number of decimal parts
%: Take-over, two-digit division of the remainder
* *: power operation, e.g. 3**2 result of 9
: In addition to the floor, the results show only the whole number of parts
Second, comparison operators
Comparison operators have the following concentrations:
= =: equals
! =: Not equal, recommended use
<>: Not equal to, Python3 has been abandoned
: Greater Than
<: Less than
>=: greater than or equal to
<=: Less than or equal to
Three, assignment operators
The assignment operators have the following types of values:
=: The simplest assignment, such as a=2
+=:a+=2, equivalent to a=a+2
-=:a-=2, equivalent to A=a-2
*=:a*=2, equivalent to A=a*2
/=:a/=2, equivalent to A=A/2
%=:a%=2, equivalent to a=a%2
**=:a**=2, equivalent to A=a**2
=:a//=2, equivalent to A=A//2
Four, logical operators
There are several logical operators:
And: Logic and, only the two sides of the conditions are set up, and finally set up. For example true and true result is true,true and false result is false
Or: Logical OR, both sides of the condition as long as one side is established, and finally set up. For example true or false result is true
Not: logical non, conditional negate. For example not true result is false,not false result is true
Priority: Not>and>or
Python Base value operator