Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def unify(hour, min, sec=0):
- return (hour * 60 + min) * 60 + sec
- def time(km, sec_per_km):
- return km * sec_per_km
- def add_zero(s):
- return '0' * (2 - len(s)) + s
- def format(cur_time):
- hour = add_zero(str((cur_time // 60 // 60) % 24))
- min = add_zero(str((cur_time // 60) % 60))
- sec = add_zero(str(cur_time % 60))
- return hour + ':' + min + ':' + sec
- start = unify(6, 52)
- light = unify(0, 8, 15)
- hard = unify(0, 7, 12)
- print(format(start + time(1, light) + time(3, hard) + time(1, light)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement