Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- exam_hour = int(input())
- exam_minutes = int(input())
- arrival_hour = int(input())
- arrival_minutes = int(input())
- total_exam = exam_hour * 60 + exam_minutes
- total_arrival = arrival_hour * 60 + arrival_minutes
- type = ""
- if total_arrival > total_exam:
- type = "Late"
- elif total_arrival + 30 < total_exam:
- type = "Early"
- elif total_arrival <= total_exam:
- type = "On time"
- print(type)
- difference = abs(total_exam - total_arrival)
- if total_arrival < total_exam and total_exam - total_arrival >= 60:
- print(f"{difference // 60}:{difference % 60:02d} hours before the start")
- elif total_exam - total_arrival <= 60 and total_arrival < total_exam:
- print(f"{total_exam - total_arrival} minutes before the start")
- if total_arrival > total_exam and total_arrival - total_exam >= 60:
- print(f"{difference // 60}:{difference % 60:02d} hours after the start")
- elif total_arrival - total_exam <= 60 and total_arrival > total_exam:
- print(f"{total_arrival - total_exam} minutes after the start")
Advertisement
Add Comment
Please, Sign In to add comment