Running Speed
Source: May 2025, Task 3 (DTU 02002/02003). Study solution — not an official answer key.
Problem
Pace is given in minutes per kilometer. Convert pace to speed in km/h and m/s.
Write running_speed(pace) returning a tuple (km_h, m_s).
pace: float — minutes per kilometer- Returns: tuple of two floats
Example: pace 5.5 → about 10.909 km/h and 3.030 m/s.
Example
>>> running_speed(5.5)
(10.90909090909091, 3.0303030303030307)
Approach
Speed in km/h is 60 / pace. Speed in m/s is 1000 / (pace * 60).
Solution
Show solution Hide solution
Solution
def running_speed(pace):
km_h = 60 / pace
m_s = 1000 / (pace * 60)
return (km_h, m_s)