Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. mylist = [98, 72, 56, 34, 27, 12]
  2. spare = 0
  3. swaps = True
  4. while swaps == True:
  5. print(mylist)
  6. swaps = False
  7. for index in range (0,5):
  8. if mylist[index] > mylist[index + 1]:
  9. spare = mylist[index]
  10. mylist[index] = mylist[index + 1]
  11. mylist[index + 1] = spare
  12. swaps = True
  13.  
  14.  
  15. mylist = [ ]
  16. for count = (0,6):
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement