[sf-lug] [PYCLASS] Still on exercise 2.1

jim jim at well.com
Fri Oct 3 22:10:51 PDT 2008

   re-express all time in decimal format. 
   15 minutes is 0.25 hours. 52 is how many 
parts of 60? (what's the decimal representation 
of 6 and 52/60s of an hour?) 
   then you have a start time expressed in 
decimal format, you add to that the running 
time in decimal format, then you re-express 
the sum as hours and minutes. 
   the trick is to convert all data to the 
same format, at least with respect to a set 
of related operations, and when done, 
re-convert the final data to the format you 
want to report. 

On Fri, 2008-10-03 at 21:32 -0700, Christian Einfeldt wrote:
> Oh no!  The hamster tripped and fell off its wheel!  Can you help the
> hamster get back on?  here is the problem that tripped the hamster.
> Now I will preface this question by saying that I was a poli sci major
> for undergrad, and I worked very hard to get a D in Algebra 2, so with
> that in mind, here we go:
> If I leave my house at 6:52 am and run 1 mile at an easy pace (*:15
> per mile), then 3 miles at tempo (7:12) per mile) and 1 mile at easy
> pace again, what time do I get home for breakfast? 
> I was able to get the total time of his run, at 38.10 minutes,
> expressed as follows, 
> >>> (2.0*8.25)+(3*7.20)
> 38.100000000000001
> But I was not able to figure out how to use Python to add the time of
> his jogging to the clock hours.  I did notice that 52 and 60 are both
> evenly divisible by 4, but that didn't help me.  The problem for me
> here is converting 60 minute hour.  If his run time had been only 6
> minutes, I could have fudged it by doing
> >>> 6.52+.06
> 6.5799999999999992
> but that is still not clean for the obvious reasons.  Any suggestions?
> Thx.

More information about the sf-lug mailing list