rename var

This commit is contained in:
onyx-and-iris 2024-01-05 12:37:49 +00:00
parent 02b8e94dcc
commit 5b6a20dedf

View File

@ -16,15 +16,15 @@ artists = [
def selectionSort(array, size): def selectionSort(array, size):
for ind in range(size): for index in range(size):
min_index = ind min_index = index
for j in range(ind + 1, size): for j in range(index + 1, size):
# select the minimum element in every iteration # select the minimum element in every iteration
if array[j].count < array[min_index].count: if array[j].count < array[min_index].count:
min_index = j min_index = j
# swapping the elements to sort the array # swapping the elements to sort the array
(array[ind], array[min_index]) = (array[min_index], array[ind]) (array[index], array[min_index]) = (array[min_index], array[index])
selectionSort(artists, len(artists)) selectionSort(artists, len(artists))