How to calculate a mod b in Python?

后端 未结 7 1261
迷失自我
迷失自我 2020-12-12 21:47

Is there a modulo function in the Python math library?

Isn\'t 15 % 4, 3? But 15 mod 4 is 1, right?

相关标签:
7条回答
  • 2020-12-12 22:12

    Why don't you use % ?

    
    print 4 % 2 # 0
    
    0 讨论(0)
提交回复
热议问题