def swap(A, x, y):
A[x], A[y] = A[y], A[x]
return A
def selection_sort(A):
for i in range(len(A)):
smallest = i
for j in range(i+1, len(A)):
if A[smallest] > A[j]:
smallest = j
if smallest != i:
swap(A, i, j)
A = [23, 10, 6, 40, 25]
print(selection_sort(A))
您必须在selection_sort函数中最后一条指令“返回A”