re: Daily Challenge #36 - Let's go for a run! VIEW POST

FULL DISCUSSION
 
def running_pace(distance, time):
    minutes, seconds = [int(part) for part in time.split(':')]

    total_seconds = minutes * 60 + seconds
    seconds_per_km = total_seconds / distance

    pace_minutes = int(seconds_per_km // 60)
    pace_seconds = int(seconds_per_km % 60)
    return f'{pace_minutes}:{pace_seconds:02d}'
code of conduct - report abuse