The input I get the user to enter is seconds. Most of the time I am able to convert my input to the hh:mm:ss format but when the numbers get a bit larger I seem to run into some issues. For example when I input 900, I get a result of 01:15:-100. I especially don't want negatives and only want two digests (no decimals either) per each number. Not sure if I have gone wrong on my math.
if sys.argv[1] == "raceTime":
n = int(sys.argv[2])
if n < 60:
s = format(number, '0>2.0f')
print("{}:{}:{}".format(00, 00, s))
else:
n = int (sys.argv[2])/60
m =n//1
h = min//10
s = (n - h - m)*100
second = format(s,'0>2.0f')
minute = format(m, '0>2.0f')
hour = format(h, '0>2.0f')
print("{}:{}:{}".format(hour, minute, second))