def time_to_seconds(time_str):
"""Convert a time string in format 'MM:SS' or 'HH:MM:SS' to total seconds."""
parts = list(map(int, time_str.split(':')))
if len(parts) == 2: # MM:SS
return parts[0] * 60 + parts[1]
elif len(parts) == 3: # HH:MM:SS
return parts[0] * 3600 + parts[1] * 60 + parts[2]
def seconds_to_time(seconds):
"""Convert total seconds to 'MM:SS' or 'HH:MM:SS' format."""
hours = seconds // 3600
minutes = (seconds % 3600) // 60
sec = seconds % 60
if hours > 0:
return f'{hours:02}:{minutes:02}:{sec:02}'
else:
return f'{minutes:02}:{sec:02}'
def calculate_paces(race_time, race_distance_km):
"""Calculate training paces based on race time and distance."""
# Convert race time to total seconds
race_time_seconds = time_to_seconds(race_time)
# Calculate average pace per km
pace_per_km = race_time_seconds / race_distance_km
# Calculate different training paces based on percentages
paces = {
'long_run_pace': seconds_to_time(pace_per_km * 1.15), # 115% of race pace for long runs
'recovery_run_pace': seconds_to_time(pace_per_km * 1.20), # 120% for recovery runs
'tempo_pace': seconds_to_time(pace_per_km * 1.10), # 110% of race pace for tempo runs
'interval_pace': seconds_to_time(pace_per_km * 0.95), # 95% for intervals
'fartlek_easy_pace': seconds_to_time(pace_per_km * 1.20), # Mix of easy and interval paces
'fartlek_fast_pace': seconds_to_time(pace_per_km * 0.95),
'hill_repeats_pace': seconds_to_time(pace_per_km * 0.90) # Faster than intervals for hill repeats
}
return paces
# Example usage
race_time = '19:00' # 5K time in 'MM:SS'
race_distance_km = 5 # 5K
paces = calculate_paces(race_time, race_distance_km)
print(f"Long Run Pace: {paces['long_run_pace']} per km")
print(f"Recovery Run Pace: {paces['recovery_run_pace']} per km")
print(f"Tempo Pace: {paces['tempo_pace']} per km")
print(f"Interval Pace: {paces['interval_pace']} per km")
print(f"Fartlek Easy Pace: {paces['fartlek_easy_pace']} per km")
print(f"Fartlek Fast Pace: {paces['fartlek_fast_pace']} per km")
print(f"Hill Repeats Pace: {paces['hill_repeats_pace']} per km")

Why give?
-
✽
It all begins with an idea. Maybe you want to launch a business. Maybe you want to turn a hobby into something more.
-
✽
It all begins with an idea. Maybe you want to launch a business. Maybe you want to turn a hobby into something more.
-
✽
It all begins with an idea. Maybe you want to launch a business. Maybe you want to turn a hobby into something more.
-
✽
It all begins with an idea. Maybe you want to launch a business. Maybe you want to turn a hobby into something more.
-
✽
It all begins with an idea. Maybe you want to launch a business. Maybe you want to turn a hobby into something more.
-
✽
It all begins with an idea. Maybe you want to launch a business. Maybe you want to turn a hobby into something more.

“It all begins with an idea. Maybe you want to launch a business.”
Keith Finley
“It all begins with an idea. Maybe you want to launch a business.”
Monet Goode
“It all begins with an idea. Maybe you want to launch a business.”
Channing Lee
Make a donation.
It all begins with an idea. Maybe you want to launch a business. Maybe you want to turn a hobby into something more. Or maybe you have a creative project to share with the world. Whatever it is, the way you tell your story online can make all the difference.
FAQs
-
It all begins with an idea. Maybe you want to launch a business. Maybe you want to turn a hobby into something more. Or maybe you have a creative project to share with the world. Whatever it is, the way you tell your story online can make all the difference.
-
It all begins with an idea. Maybe you want to launch a business. Maybe you want to turn a hobby into something more. Or maybe you have a creative project to share with the world. Whatever it is, the way you tell your story online can make all the difference.
-
It all begins with an idea. Maybe you want to launch a business. Maybe you want to turn a hobby into something more. Or maybe you have a creative project to share with the world. Whatever it is, the way you tell your story online can make all the difference.
-
It all begins with an idea. Maybe you want to launch a business. Maybe you want to turn a hobby into something more. Or maybe you have a creative project to share with the world. Whatever it is, the way you tell your story online can make all the difference.