Exercise 3 solution (Python) def naismith(km, ascent_m): return km / 5 * 60 + ascent_m / 10 def with_breaks(minutes, per_hour=5): return minutes + minutes / 60 * per_hour legs = [(2.0, 120), (1.5, 0), (3.5, 380)] total = 0 for km, ascent in legs: t = naismith(km, ascent) total += t print(km, "km,", ascent, "m ascent:", t, "min") print("Total moving time:", total, "min") print("With breaks:", round(with_breaks(total)), "min") print("Distance:", sum(km for km, a in legs), "km; ascent:", sum(a for km, a in legs), "m") Output: 2.0 km, 120 m ascent: 36.0 min 1.5 km, 0 m ascent: 18.0 min 3.5 km, 380 m ascent: 80.0 min Total moving time: 134.0 min With breaks: 145 min Distance: 7.0 km; ascent: 500 m So the moving time is 134 minutes (2 h 14 min), about 2 h 25 min with breaks, for 7.0 km and 500 m of ascent. Check by hand: 7 km is 84 minutes, 500 m of ascent is 50 minutes, 84 + 50 = 134.