Answer:
def cal_time(distance, speed):
time = distance / speed
hour = str(time)[0]
minutes = round(float(str(time)[1:]) * 60)
print(f"The time taken to cover {distance}miles is {hour}hours, {minutes}minutes")
miles = [5, 10, 13.1, 26.2]
myspeed = int(input("Enter user speed: "))
for mile in miles:
cal_time(mile, myspeed)
Step-by-step explanation:
The python program prints out the time taken for a runner to cover the list of distances from 5 miles to a full marathon. The program prompts for the speed of the runner and calculates the time with the "cal_time" function.