seconds=25643
m, s = divmod(seconds, 60)
h, m = divmod(m, 60)
print ("%02d:%02d:%02d" % (h, m, s))
print(f"Etc time: {int(h)}:{int(m)}:{int(s)}")
输出:
参考文章:
- 【Python基础】python如何把秒换成时分秒
微信扫一扫
seconds=25643
m, s = divmod(seconds, 60)
h, m = divmod(m, 60)
print ("%02d:%02d:%02d" % (h, m, s))
print(f"Etc time: {int(h)}:{int(m)}:{int(s)}")
输出:
参考文章:
相关推荐