Advertisement
Guest User

https://ehazi.hu/q/115732

a guest
Sep 11th, 2022
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. s = int( input("Másodperc: ") )
  2.  
  3. years, s = divmod(s, 60*60*24*30*12)
  4. months, s = divmod(s, 60*60*24*30)
  5. days, s = divmod(s, 60*60*24)
  6. hours, s = divmod(s, 60*60)
  7. minutes, seconds = divmod(s, 60)
  8.  
  9. print(f"{years} év {months} hó {days} nap {hours} óra {minutes} perc {seconds} mp")
  10.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement