-1
I’m having trouble presenting the result of the transformation of a specific time, in the form HH:MM:SS
, in seconds. The result is correct, but with a .0
in the end, which makes my response invalid on a website.
My code:
horario = input()
hora = float(horario[0:2])* int(3600)
minuto = float(horario[3:5])* int(60)
segundo = float(horario[6:8])
C = float(hora + minuto + segundo)
print(int(C))
# Saída: 18711.0
There’s no way out with the
.0
in the end is using theint
. Are you sure this is the code you executed? If so, please elaborate a [mcve] on https://repl.it/languages/python3 demonstrating the problem.– Woss