def get_sec(time_str):
“”“Get Seconds from time.”“”
h, m, s = time_str.split(‘:’)
return int(h) * 3600 + int(m) * 60 + int(s)
print(get_sec('1:23:45'))print(get_sec('0:04:15'))print(get_sec('0:00:25'))
欢迎分享,转载请注明来源:内存溢出
def get_sec(time_str):
“”“Get Seconds from time.”“”
h, m, s = time_str.split(‘:’)
return int(h) * 3600 + int(m) * 60 + int(s)
print(get_sec('1:23:45'))print(get_sec('0:04:15'))print(get_sec('0:00:25'))
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)