li=[1,4,7,9,2,6,8,]for j in range(1,len(li)): for i in range(len(li)-j): if li[i]>li[i+1]: temp=li[i] li[i]=li[i+1] li[i+1]=tempprint(li)