Ddimov90

on_time_for_the_exam_08_02

Sep 30th, 2025
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.34 KB | Source Code | 0 0
  1. test_hour = int(input())
  2. test_minute = int(input())
  3. arriving_hour = int(input())
  4. arriving_minute = int(input())
  5.  
  6. total_minutes_test = test_hour * 60 + test_minute
  7. total_minutes_arrival = arriving_hour * 60 + arriving_minute
  8.  
  9. if total_minutes_arrival > total_minutes_test:
  10.     total_minutes = total_minutes_arrival - total_minutes_test
  11.     hours = total_minutes // 60
  12.     minutes = total_minutes % 60
  13.     print("Late")
  14.     if hours < 1:
  15.         print(f"{minutes} minutes after the start")
  16.     else:
  17.         if minutes >= 10:
  18.             print(f"{hours}:{minutes} hours after the start")
  19.         else:
  20.             print(f"{hours}:0{minutes} hours after the start")
  21.  
  22. elif total_minutes_test >= total_minutes_arrival and total_minutes_test - total_minutes_arrival <= 30:
  23.     print("On time")
  24.     if total_minutes_test - total_minutes_arrival != 0:
  25.         print(f"{total_minutes_test - total_minutes_arrival} minutes before the start")
  26.  
  27. else:
  28.     print("Early")
  29.     total_minutes = total_minutes_test - total_minutes_arrival
  30.     hours = total_minutes // 60
  31.     minutes = total_minutes % 60
  32.     if hours < 1:
  33.         print(f"{minutes} minutes before the start")
  34.     else:
  35.         if minutes >= 10:
  36.             print(f"{hours}:{minutes} hours before the start")
  37.         else:
  38.             print(f"{hours}:0{minutes} hours before the start")
  39.  
Advertisement
Add Comment
Please, Sign In to add comment