userinput = int(input("Enter some seconds: ")) mins = 0 hrs = 0 while userinput >= 60 : userinput = userinput - 60 mins = mins + 1 while mins >= 60 : mins = mins - 60 hrs = hrs + 1 print(hrs, "hours") print(mins, "minutes") print(userinput, "seconds") #working