Skip to content

Commit

Permalink
Adding pace_calc.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenDowney committed Aug 28, 2013
1 parent b080d8f commit 99b5599
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 0 deletions.
Empty file modified Card.py
100755 → 100644
Empty file.
Empty file modified Tagger.py
100755 → 100644
Empty file.
Empty file modified Threader.py
100755 → 100644
Empty file.
Empty file modified Threader_soln.py
100755 → 100644
Empty file.
Empty file modified Wanderer.py
100755 → 100644
Empty file.
Empty file modified image_demo.py
100755 → 100644
Empty file.
Empty file modified lumpy_diag05.py
100755 → 100644
Empty file.
Empty file modified markov.py
100755 → 100644
Empty file.
26 changes: 26 additions & 0 deletions pace_calc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""
Code example from Think Python, by Allen B. Downey.
Available from http://thinkpython.com
Copyright 2013 Allen B. Downey.
Distributed under the GNU General Public License at gnu.org/licenses/gpl.html.
If you run a 10 kilometer race in 43 minutes 30 seconds, what is your
average time per mile? What is your average speed in miles per hour?
(Hint: there are 1.61 kilometers in a mile).
"""

minutes = 43.5
hours = minutes / 60

km_per_mile = 1.61
km = 10
miles = km / km_per_mile

pace = minutes / miles
mph = miles / hours

print 'Pace in minutes per mile:', pace
print 'Average speed in mph:', mph

0 comments on commit 99b5599

Please sign in to comment.