JaTu

Untitled

Jul 23rd, 2021
1,065
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Сделайте так, чтобы число секунд отображалось в виде дни:часы:минуты:секунды.
  2.  
  3. sec = 123456789
  4.  
  5. day = 86400
  6. hour = 3600
  7. minute = 60
  8. second = 1
  9.  
  10. days = sec // day
  11. hours = (sec % day) // hour
  12. minutes = ((sec % day) % hour) // minute
  13. seconds = ((sec % day) % hour) % minute
  14. print(days, hours, minutes, seconds, sep=':')
RAW Paste Data