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