1 lis=[2,1,4,7,8,5,9] 2 for i in range(len(lis)-1): 3 for j in range(i+1,len(lis)): 4 if lis[i]>lis[j]: 5 lis[i],lis[j]=lis[j],lis[i] 6 print(lis)