【发布时间】:2020-07-27 16:36:27
【问题描述】:
hr = int(input("Enter current hr:"))
min= int(input("Enter current min:"))
sec = int(input("Enter current sec:"))
print("Clock time now is",hr,":",min,":",sec)
sec= sec+1
print("After 1 second, the time is",hr,":",min,":",sec)
我如何也将输入限制在一定范围内?像小时的输入只接受0-23和分钟0-50秒0-59的范围?以及如何使 sec + 1 自动更新小时和分钟的结束时间?假设 23 : 59 : 59+1 = 00:00:00
【问题讨论】:
-
也许这可以帮助你:stackoverflow.com/questions/100210/…
标签: python python-3.x datetime python-requests pycharm