On Fri, Jan 31, 2014 at 7:17 PM, Gregory Ewing <greg.ew...@canterbury.ac.nz> wrote: > sjud9227 wrote: >> >> Doesn't >> assigning seconds/(60*60) mean that calculating 6*hours will give me 6 >> hours >> in seconds? > > No, it's giving you 6 seconds in hours. (That should > give you a clue as to what you should have done > instead. :-) > > ... > > a // b gives the quotient of dividing a by b > > a % b gives the remainder > > (I recommend using '//' rather than just '/', because > in some versions of Python, a/b does floating point > division even if a and b are both integers, and that's > not what you want here.)
OP is using 2.7.6, so short of a __future__ directive, that won't actually give 6 seconds in hours (though it will try to), and // is unnecessary. ChrisA -- https://mail.python.org/mailman/listinfo/python-list