将数组追加到不同的数组 N 次 (python)

Appending Array into different array N times (python)

谢谢,已经解决了,祝你有愉快的一天

我没有检查排序算法是否正确实现。但是如果我解决了你的问题,你可以使用 copy.deepcopy:

import copy

...

for i in range(size):
    print(A)
    masterList.append(copy.deepcopy(A))  # This line has changed
    for j in reversed(range(1,size)):
        if A[j] < A[j-1]:
            A[j], A[j-1] = A[j-1], A[j]