【发布时间】:2021-09-28 14:32:57
【问题描述】:
我尝试从 Python 迁移到 Golang。我目前正在研究一些数学运算,并想知道如何获得除法结果的商和余数。我将在下面分享一个等效的 Python 代码。
hours, remainder = divmod(5566, 3600)
minutes, seconds = divmod(remainder, 60)
print('%s:%s' % (minutes, seconds))
# 32:46
以上将是我的目标。谢谢。
【问题讨论】:
标签: go