0
点赞
收藏
分享

微信扫一扫

Python——秒数转时间

快乐与微笑的淘气 2022-05-05 阅读 171
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)}")

输出:

参考文章:

  • 【Python基础】python如何把秒换成时分秒
举报

相关推荐

0 条评论