Someone in Stackoverflow answered my question which was brilliant, I need to replace the print statements with formulas.
The reason for this so I can convert the output to hours, minutes, seconds.
Having multiple print statements and the formula included I can not separate them.
I have three logics but just need to separate them into formulas like the print statement.
Original program:
T17 = input('?')
if T17 < 0:
print("LOCAL SIDEREAL TIME",T17 + 24)
elif T17 > 24:
print("LOCAL SIDEREAL TIME",T17 - 24)
else:
print("LOCAL SIDEREAL TIME",T17)
This is what I am trying to do.
T17 = input('?')
if T17 < 0:
T17 + 24
elif T17 > 24:
T17 - 24
else:
print("LOCAL SIDEREAL TIME",T17)
It seems as though you meant to re-assign the calculations back to T17
:
T17 = input('?')
if T17 < 0:
T17 = T17 + 24
elif T17 > 24:
T17 = T17 - 24
print("LOCAL SIDEREAL TIME", T17)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.