I'm trying to breakdown a users integer input into hours, minutes, and seconds for a 24 hour period but having issues with going from pseudo code to actual code past the first hour equation. I want the final output to be in X hours, Y minutes, and Z seconds:
day = 86400
hour = 3600 #1 hour in a day * 60min * 60 sec
minute = 60
number = input("Choose a number between 0 and 86400: ")
while number != 0:
if number > 0:
newNumber = number / hour
number = newNumber
I'm teaching myself coding so I would love a simple approach to this problem... Am I even on the right track?
EDIT: I know there is a duplicate version of this question but that one simplifies things a bit too much (ironic) for me. I'm trying to learn by incremental steps but I do appreciate all the feedback