当前位置 : 主页 > 编程语言 > python >

python 输入秒数转化成常见的小时,分钟,秒

来源:互联网 收集:自由互联 发布时间:2023-02-04
time = int(input("请输入秒数:"))s = round(time/1)m = round(s/60,2)h = round(s/3600,2)print(f"{0}换算后等于{s}秒,等于{m}分钟,等于{h}小时") 利用了format运用
time = int(input("请输入秒数:"))s = round(time/1)m = round(s/60,2)h = round(s/3600,2)print(f"{0}换算后等于{s}秒,等于{m}分钟,等于{h}小时")

利用了format运用

上一篇:Python爬虫-第一章-3-基础语法
下一篇:没有了
网友评论