Python Time and Distance Calculation

Posted on Aug. 18, 2020 by Ted Martin

The following questions are a good way to dip our toes into Python's ability to calculate values.

How many seconds are there in 42 minutes and 42 seconds?

42 * 60 = 2520

2520 + 42 = 2562

There are 2562 seconds in 42 minutes and 42 seconds.

How many miles are there in 10 kilometers? Hint: there are 1.61 kilometers in a mile.

10 / 1.61 = 6.21

There a 6.21 miles in 10 kilometers

If you run a 10 kilometer race in 42 minutes and 42 seconds, what is your average pace (time per mile in minutes and seconds)? What is your average speed in miles per hour?

6.21 / 2562 = 0.0024 miles per second

6.21 / 42.7 = 0.145 miles per minute

6.21 / 0.7116 = 8.726 miles per hour

Share post

0 comments

There are no comments yet.

Add a new comment