Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.15 KB | None | 0 0
  1. li=[1,4,2,5,13,7]
  2. n=1
  3. while n<len(li):
  4. for i in range(0,len(li)-n):
  5. if li[i]<li[i+1]:
  6. li[i],li[i+1]=li[i+1],li[i]
  7. n+=1
  8. print(li)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement