Jorell_Ramos_Sinaga

Untitled

Dec 16th, 2021
1,112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. d1 = int(input().split()[-1])
  2. h1,m1,s1 = map(int,input().split(" : "))
  3.  
  4. d2 = int(input().split()[-1])
  5. h2,m2,s2 = map(int,input().split(" : "))
  6.  
  7. d = d2 - d1
  8. h = h2 - h1
  9. m = m2 - m1
  10. s = s2 - s1
  11.  
  12. if s<0:
  13.     s = s+60
  14.     m = m-1
  15. if m<0:
  16.     m = m+60
  17.     h = h-1
  18. if h<0:
  19.     h = h+24
  20.     d = d-1
  21.  
  22. print(d, "dia(s)")
  23. print(h, "hora(s)")
  24. print(m, "minuto(s)")
  25. print(s, "segundo(s)")
Advertisement
Add Comment
Please, Sign In to add comment