Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exam_hour = int(input())
- exam_minutes = int(input())
- arrival_hour = int(input())
- arrival_minutes = int(input())
- exam_total_minutes = exam_hour * 60 + exam_minutes
- arrival_total_minutes = arrival_hour * 60 + arrival_minutes
- diff = abs(exam_total_minutes - arrival_total_minutes)
- new_hours = diff // 60
- new_minutes = diff % 60
- if arrival_total_minutes > exam_total_minutes:
- print('Late')
- if diff < 60:
- print(f'{new_minutes} minutes after the start')
- else:
- if new_minutes >= 10:
- print(f'{new_hours}:{new_minutes} hours after the start')
- else:
- print(f'{new_hours}:0{new_minutes} hours after the start')
- elif arrival_total_minutes < exam_total_minutes:
- if diff <= 30:
- print('On time')
- if diff < 60:
- print(f'{new_minutes} minutes before the start')
- else:
- if new_minutes >= 10:
- print(f'{new_hours}:{new_minutes} hours before the start')
- else:
- print(f'{new_hours}:0{new_minutes} hours before the start')
- elif arrival_total_minutes == exam_total_minutes:
- print('On time')
- elif arrival_total_minutes < exam_total_minutes and diff > 30:
- print('Early')
- if diff < 60:
- print(f'{new_minutes} minutes before the start')
- else:
- if new_minutes >= 10:
- print(f'{new_hours}:{new_minutes} hours before the start')
- else:
- print(f'{new_hours}:0{new_minutes} hours before the start')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement