python算法运算

  

>>> b = 10
>>> b /= 8
>>> b
1.25
>>> 10 // 8
1
>>>

**幂运算

>>> 3**2
9
>>>

取模

>>> 11 % 2
1

python默认真实除法运算
>>> 11 / 2
5.5

地板除
>>> 11 // 2
5
>>>

>>> not 0
True
>>> not 1
False
>>> not True
False
>>> not False
True


>>>3<4<5  等同于3<4 and 4<5

原文地址:https://www.cnblogs.com/xiaohouzai/p/7638155.html