Help with some python homework...

Chris Angelico rosuav at gmail.com
Fri Jan 31 19:57:32 EST 2014


On Sat, Feb 1, 2014 at 11:42 AM, Scott W Dunning <swdunning at cox.net> wrote:
> Also, any help on how to get the hours and seconds into double digits that would be cool too.  00:00:00

Once you can divide the number of seconds into hours, minutes, and
seconds, you can format them like this:

time = "%02d:%02d:%02d" % (hours, minutes, seconds)

I'll give you that one for free because I don't think it's
particularly critical to your course, but it will look better that way
:) Look up the string formatting features of Python in the docs.

ChrisA



More information about the Python-list mailing list