Python 2.7.6 help with modules

Asaf Las roegltd at gmail.com
Sat Feb 8 00:21:41 EST 2014


On Saturday, February 8, 2014 7:05:49 AM UTC+2, Rustom Mody wrote:
> On Saturday, February 8, 2014 10:14:10 AM UTC+5:30, Scott W Dunning wrote:
> 
> > I have a question that was a part of my homework 
> > and I got it correct but the teacher urged me to do it using the 
> > % sign rather than subtracting everything, for some reason I'm 
> > having issues getting it to calculate correctly.  I'll put the 
> > question below, and what I originally had and below that what 
> > I've been working on with the %.   
> >


just 2 lines, they are self explanatory 

days    = int((seconds % (60 * 60 * 24 * 7))/(60 * 60 * 24))
hours   = int((seconds % (60 * 60 * 24))/(60 * 60))

feel free to ask

/Asaf



More information about the Python-list mailing list