File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ """This module contains a code example related to
2+
3+ Think Python, 2nd Edition
4+ by Allen Downey
5+ http://thinkpython2.com
6+
7+ Copyright 2015 Allen Downey
8+
9+ License: http://creativecommons.org/licenses/by/4.0/
10+ """
11+
12+
13+
14+ """
15+
16+ If I leave my house at 6:52 am and run 1 mile at an easy pace
17+ (8:15 per mile), then 3 miles at tempo (7:12 per mile) and
18+ 1 mile at easy pace again, what time do I get home for breakfast?
19+
20+ """
21+
22+ easy_min = 8 + 15 / 60
23+ tempo_min = 7 + 12 / 60
24+
25+ total_min = 2 * easy_min + 3 * tempo_min
26+ print ('Total minutes:' , total_min )
27+
28+ time_hour = 6 + 52 / 60 + total_min / 60
29+ print ('Time in hours' , time_hour )
30+
31+ hours = 7
32+ minutes = (time_hour - hours ) * 60
33+ print ('Time in hours and minutes' , hours , minutes )
You can’t perform that action at this time.
0 commit comments