python之关于时间的小玩意,很受启发

#coding:utf-8
hour = int(input("Enter hour: "))
minute = int(input("Enter minute: "))
second = int(input("Enter second"))

currentTime = hour, minute, second

print("The number of secondes since midnight is", \
      (currentTime[0] * 3600 + currentTime[1] * 60 + currentTime[2]))

该程序对格式化时间差很有帮助和启发

 

 

End!

posted @ 2016-06-30 19:44  知_行  阅读(217)  评论(0编辑  收藏  举报