Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. exam_hour = int(input())
  2. exam_minutes = int(input())
  3. arrival_hour = int(input())
  4. arrival_minutes = int(input())
  5.  
  6. exam_total_minutes = exam_hour * 60 + exam_minutes
  7. arrival_total_minutes = arrival_hour * 60 + arrival_minutes
  8.  
  9. diff = abs(exam_total_minutes - arrival_total_minutes)
  10.  
  11. new_hours = diff // 60
  12. new_minutes = diff % 60
  13.  
  14. if arrival_total_minutes > exam_total_minutes:
  15. print('Late')
  16. if diff < 60:
  17. print(f'{new_minutes} minutes after the start')
  18. else:
  19. if new_minutes >= 10:
  20. print(f'{new_hours}:{new_minutes} hours after the start')
  21. else:
  22. print(f'{new_hours}:0{new_minutes} hours after the start')
  23.  
  24. elif arrival_total_minutes < exam_total_minutes:
  25. if diff <= 30:
  26. print('On time')
  27. if diff < 60:
  28. print(f'{new_minutes} minutes before the start')
  29. else:
  30. if new_minutes >= 10:
  31. print(f'{new_hours}:{new_minutes} hours before the start')
  32. else:
  33. print(f'{new_hours}:0{new_minutes} hours before the start')
  34. elif arrival_total_minutes == exam_total_minutes:
  35. print('On time')
  36.  
  37. elif arrival_total_minutes < exam_total_minutes and diff > 30:
  38. print('Early')
  39. if diff < 60:
  40. print(f'{new_minutes} minutes before the start')
  41. else:
  42. if new_minutes >= 10:
  43. print(f'{new_hours}:{new_minutes} hours before the start')
  44. else:
  45. print(f'{new_hours}:0{new_minutes} hours before the start')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement