Write a function that takes seconds from the user and displays the time in Hours,
minutes and seconds’ format. E.g. if the user enters 3700, the output of the program
should be
1 Hour 1 minute and 40 seconds
def convertTime():
time =int(input("Input time in seconds: "))
hour = time // 3600
time %= 3600
minutes = time // 60
time %= 60
seconds = time
print(hour,"Hours ", minutes, "minutes ", seconds, "seconds")
convertTime()
Comments
Leave a comment