Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hours_1 = int(input())
- minutes_1 = int(input())
- hours_2 = int(input())
- minutes_2 = int(input())
- hours_3 = (hours_1 * 60) + minutes_1
- hours_4 = (hours_2 * 60) + minutes_2
- total = hours_3 - hours_4
- hh = abs(hours_1 - hours_2)
- mm = abs(minutes_1 - minutes_2)
- if total < 0:
- total = abs(total)
- print(f"Late")
- if 60 > total:
- print(f"{total} minutes after the start")
- elif 60 <= total and (mm >= 10):
- mm = total % 60
- print(f"{hh}:{mm} hours after the start")
- elif 60 <= total and (mm < 10):
- mm = total % 60
- print(f"{hh}:0{mm} hours after the start")
- elif 0 <= total <= 30:
- total = abs(total)
- print(f"On time")
- if not total == 0:
- print(f"{total} minutes before the start")
- elif 30 < total:
- total = abs(total)
- print(f"Early")
- if 30 < total < 60:
- print(f"{total} minutes before the start")
- elif 60 < total and (mm >= 10):
- hours = total // 60
- minutes = total % 60
- print(f"{hours}:{minutes:0>2d} hours before the start")
- elif 60 <= total and (mm < 10):
- hours = total // 60
- minutes = total % 60
- print(f"{hours}:{minutes:0>2d} hours before the start")
Advertisement
Add Comment
Please, Sign In to add comment