a
aunknown
python
4 years ago
747 B
10
Indexable
minToSec = 60
hToSec = 3600
marsT = 24* minToSec + 37
earthT = 24*minToSec
MEratio = marsT / earthT
h = int(input("Please enter the maintenance starting hour: \n"))
m = int(input("Please enter the maintenance starting minute: \n"))
s = int(input("Please enter the maintenance starting second: \n"))
d = int(input("Please enter the maintenance duration in second(s) according to \"Perseverance's timer: "))
totalInSec = h*hToSec + m*minToSec + s
timeInEarth = totalInSec + MEratio*d
new_h =int(timeInEarth // hToSec)
new_m = int((timeInEarth - new_h*hToSec) // minToSec)
new_s = timeInEarth - new_h*hToSec - new_m*minToSec
print("The time on Earth after the hold-up is {}:{}:{:.2f}".format((new_h % 24), new_m, new_s))
Editor is loading...