divmod()

divmod() 接收两个数值,然后以元组的形式返回这两个数值的商和余数

In [1]: divmod(5, 2) 
Out[1]: (2, 1)

In [2]: divmod(10, 7)
Out[2]: (1, 3)

    

原文地址:https://www.cnblogs.com/pzk7788/p/10263239.html