Advertisement
GeorgiLukanov87

01. Sino the Walker Exam Preparation l 100/100

Jul 19th, 2022
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. # 01. Sino the Walker Exam Preparation l 100/100
  2. # https://judge.softuni.org/Contests/Practice/Index/967#0
  3.  
  4. local_time = list(map(int, input().split(':')))
  5. steps = int(input())
  6. seconds_for_step = int(input())
  7. in_seconds = seconds_for_step * steps
  8.  
  9. start_time_s = local_time[2] + (local_time[1]*60) + (local_time[0] * 3600)
  10. time = in_seconds + start_time_s
  11. hour = time // 3600
  12. time %= 3600
  13. minutes = time // 60
  14. time %= 60
  15. seconds = time
  16.  
  17. while hour > 23:
  18.     hour %= 24
  19.  
  20. all_time = [hour] + [minutes] + [seconds]
  21. arrive_time = []
  22.  
  23. print('Time Arrival: ', end="")
  24. for el in all_time:
  25.     if len(str(el)) == 1:
  26.         el = "0" + str(el)
  27.         arrive_time.append(el)
  28.     else:
  29.         arrive_time.append(el)
  30.  
  31. print(*arrive_time, sep=":")
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement