Answer to Question #250036 in Python for python

Question #250036

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


1
Expert's answer
2021-10-12T00:36:36-0400
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()	

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS