+ plus Plus-----------------------------------
- Minus minus-------------------------------
/slash Divisible----Quotient-------------------------(priority of multiplication is higher than plus minus)
* asterisk multiplication sign----------------------------
% percent Residual----remainder-----------------
• < Less-than less than
• > Greater-than greater than sign
• <= less-than-equal less than equals sign
• >= greater-than-equal greater than equals sign
The United States we use Pemdas this abbreviation to assist the memory, it means " bracket, exponent, multiply, divide, add, Subtract "--
Parentheses exponents Multiplication Division addition subtraction-- it 's also in Python.
The priority of the operation.
First look at an example:
1 #!/usr/bin/python2 #Coding:utf-83 4 Print "I'll study number"5 6 Print "Feifei", 20+30/6#expected to be7 Print "Juanjuan", 100-25*3%4#expected to be8 Print3+2+1-5+4%2-1/3%4#expected to be 19 Print3+2<5-7#expected to be falseTen Print5>-2#expected to be true One Print5>=-2#expected to be true A Print5<=-2#expected to be false
Results:
python--operator