美文网首页
Python operator notes

Python operator notes

作者: yorkzhang | 来源:发表于2017-01-18 16:42 被阅读16次
  • if you print(2**3**2) you will get 512 instead of 64 because python calculate from right to left for this exponentiation operator (**). This is due to history reason. Use parentheses to force exactly the order you want when exponentiation is involved
    -If you print(12//15), you will get 0.

相关文章

网友评论

      本文标题:Python operator notes

      本文链接:https://www.haomeiwen.com/subject/sjcbbttx.html