fork download
  1. #Funciones
  2. from datetime import datetime
  3.  
  4. def segundos(dos):
  5. dos = dos.split(":")
  6.  
  7. x = int(dos[0])*3600
  8. y = int(dos[1])*60
  9. z = round((((x + y + int(dos[2]))*100)/86400),3)
  10. return (z)
  11.  
  12. #Código Principal
  13. C = int(input())
  14. L = []
  15. N = []
  16. for i in range (C):
  17. elemento = input()
  18. L.append(elemento)
  19.  
  20. for z in L:
  21. hora = datetime.strptime(z,"%I:%M:%S %p")
  22. dos = hora.strftime("%H:%M:%S")
  23.  
  24. print("Loading day ... ", segundos(dos), "%", sep="")
Success #stdin #stdout 0.05s 10580KB
stdin
3
12:00:01 AM
12:00:00 PM
11:59:59 PM
stdout
Loading day ... 0.001%
Loading day ... 50.0%
Loading day ... 99.999%