import random DIM = 15 arr = [random.randint(0, 100) for i in range(DIM)] print("Source array") print(arr) k = 0 kpi = [0, 0] for k in range(0, DIM - 1): m = k i = k + 1 for i in range(i, DIM): kpi[0] += 1 if arr[i] < arr[m]: m = i i += 1 if k != m: t = arr[k] arr[k] = arr[m] arr[m] = t kpi[1] += 1 k += 1 print() print("Sorted array: Select") print(arr) print() print("Compare: ", kpi[0]) print("Move: ", kpi[1])