1,Python的加,减,乘。除
>>> 2 + 2
4
>>> 50 - 5*6
20
>>> (50 - 5*6) / 4
5.0
>>> 8 / 5 # division always returns a floating point number
1.6
2,Python的取余,取整
>>> 17 / 3 # classic division returns a float
5.666666666666667
>>>
>>> 17 // 3 # floor division discards the fractional part
5
>>> 17 % 3 # the % operator returns the remainder of the division
2
>>> 5 * 3 + 2 # result * divisor + remainder
17
3,Python的幂运算
>>> 5 ** 2 # 5 squared
25
>>> 2 ** 7 # 2 to the power of 7
128
4,Python的赋值运算
>>> width = 20
>>> height = 5 * 9
>>> width * height
900
原文:https://www.cnblogs.com/wangyunqiang/p/8780118.html