Advertisement
Guest User

Untitled

a guest
Feb 6th, 2020
671
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. exam_hour = int(input())
  2. exam_minute = int(input())
  3. arrive_hour = int(input())
  4. arrive_minute = int(input())
  5.  
  6. exam_in_minutes = (exam_hour * 60) + exam_minute
  7. arrive_in_minutes = (arrive_hour * 60) + arrive_minute
  8.  
  9. diff =(exam_in_minutes - arrive_in_minutes)
  10.  
  11. if diff < 0:
  12. print("Late")
  13. hours = abs(diff // 60)
  14. minutes = abs(diff % 60)
  15. if hours == 0:
  16. print(f"{minutes} minutes after the start")
  17. else:
  18. print(f"{hours}:{minutes:02d} hours after the start")
  19.  
  20. elif 0 <= diff <= 30:
  21. print(f"{diff} On time")
  22. if diff > 0:
  23. print(f"{diff} minutes before the start")
  24.  
  25. elif diff > 30:
  26. print("Early")
  27. hours = abs(diff // 60)
  28. minutes = abs(diff % 60)
  29. if hours == 0:
  30. print(f"{minutes} minutes before the start")
  31. else:
  32. print(f"{hours}:{minutes:02d} hours before the start")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement