A=[3,7,9,1,6,8,4,5,2] print('ソート前',A) for i in range(len(A)-1): for j in range(len(A)-1,i,-1): if A[j]<A[j-1]: tmp=A[j] A[j]=A[j-1] A[j-1]=tmp print('ソート後',A)
To embed this project on your website, copy the following code and paste it into your website's HTML: