Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import datetime
- if __name__ == '__main__':
- first = list(map(int, input().split(":")))
- second = list(map(int, input().split(":")))
- first_timestamp = datetime.timedelta(hours=first[0], minutes=first[1])
- second_timestamp = datetime.timedelta(hours=second[0], minutes=second[1])
- res = (first_timestamp + second_timestamp).total_seconds() % (24 * 60 * 60)
- print(f"{int(res / 60 / 60):02}:{int((res % (60*60)) / 60):02}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement