[Solved]Python Need Calculate Average Time 10 Runs Program Go Code Import Randomimport Timedef Bub Q37073832
Python I need to calculate average time between all 10 runs of the program. How do I go about doing that?Here is the code:import randomimport timedef bubbleSort(alist): for passnum in range(len(alist)-1,0,-1): for i in range(passnum): if alist[i]>alist[i+1]: temp = alist[i] alist[i] = alist[i+1] alist[i+1] = tempprint(“n”)# Iterating the code for 10 timesfor i in range(10): # Starting the timer start = time.time() # Generating random list alist = random.sample(range(1, 100), 10) # Calling bubbleSort bubbleSort(alist) # Printing list print(alist) # Stopping time end = time.time() # Printing time taken print(” Time Taken: ” + str(end – start) + ” seconds n”)
Expert Answer
Answer to Python I need to calculate average time between all 10 runs of the program. How do I go about doing that? Here is the c… . . .
OR

