Last active
December 14, 2015 12:48
-
-
Save tetra5/5089076 to your computer and use it in GitHub Desktop.
Convert seconds to h:m:s with divmod
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
minutes, seconds = divmod(seconds, 60) | |
hours, minutes = divmod(minutes, 60) | |
print "%d:%02d:%02d" % (hours, minutes, seconds) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment