Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

PYTHON for BEGINNERS. I need help with fixing my wrong code. Thank you. **You\'r

ID: 3795909 • Letter: P

Question

PYTHON for BEGINNERS. I need help with fixing my wrong code. Thank you.

**You're a swimmer, and you want to compare all of your race times to find the fastest one. Write a program that continuously takes race times as doubles from standard input, until the input is "no more races," at which point it should print out the time of your fastest race.**

------------------------------------------------------

list [input]
race_time = float (input ("Enter a race time: "))
while race_time >0:
   print ("no more races")
print (min (list)

Explanation / Answer

inputlist=[] #to store race times
race_time = float (input ("Enter a race time: ")) #take input
while race_time >0:
   race_time = float (input ("Enter a race time: "))
   if race_time >0:
       inputlist.append(race_time)#append time to list if greater than 0

print "Time for fastest race is ",min(inputlist) #to find fast time take minimum from list
******************************************************************************************************************

Output:

akshay@akshay-Inspiron-3537:~/Chegg$ python run.py
Enter a race time: 12
Enter a race time: 11
Enter a race time: 36
Enter a race time: 1
Enter a race time: 0
Time for fastest race is 1.0