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

 

posted on 2017-10-08 18:36  尴尬而不失礼貌的微笑  阅读(155)  评论(0)    收藏  举报