I'm timing different sorting algorithms with multiple arrays of numbers that I've generated. I have to show the time it takes to sort each array. How can I turn code like this
print(f'bubble sort for test_array1 took {time_difference1} seconds')
print(f'bubble sort for test_array2 took {time_difference2} seconds')
print(f'bubble sort for test_array3 took {time_difference3} seconds')
print(f'bubble sort for test_array4 took {time_difference4} seconds')
print(f'bubble sort for test_array5 took {time_difference5} seconds')
into something like this?
for i in range(1,6):
print("bubble sort for", test_array(i),"took", time_difference(i),"seconds")
where the "i" would be added to the end of the variable name to show each test.