Advertisement
eNeRGy90

Untitled

Mar 7th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1.  
  2. time = input()
  3. steps = int(input())
  4. step_sec = int(input())
  5.  
  6. hour = int(time.split(":")[0])
  7. minute = int(time.split(":")[1])
  8. total_seconds = int(time.split(":")[2])
  9.  
  10. seconds_in_day = 86400
  11. seconds_in_hour = 3600
  12. seconds_in_minute = 60
  13.  
  14. total_seconds = (((hour*60)*60) + (minute * 60) + total_seconds) + (steps * step_sec)
  15.  
  16.  
  17. days = total_seconds // seconds_in_day
  18. total_seconds = total_seconds - (days * seconds_in_day)
  19.  
  20. hours = total_seconds // seconds_in_hour
  21. total_seconds = total_seconds - (hours * seconds_in_hour)
  22.  
  23. minutes = total_seconds // seconds_in_minute
  24. total_seconds = total_seconds - (minutes * seconds_in_minute)
  25.  
  26. print(f"Time Arrival: {hours:02d}:{minutes:02d}:{total_seconds:02d}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement