Best way to convert a string (like 1:00, 3:45) to a float? I'm planning on use this (see below) code to calculate the time for a runner's 2 and 3 mile times but I need to first convert a string into an int or float to be able to use it in these calculations.
twoMileTimes=[]
threeMileTimes=[]
for i in range(len(runnerNames)):
twoMileTimes.append(round(twoMileMark[i]-oneMileMark[i],2))
threeMileTime = fiveKMark[i]*(3/3.1)
threeMileTime -= twoMileMark[i]
threeMileTimes.append(round(threeMileTime,2))