Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mylist = [98, 72, 56, 34, 27, 12]
- spare = 0
- swaps = True
- while swaps == True:
- print(mylist)
- swaps = False
- for index in range (0,5):
- if mylist[index] > mylist[index + 1]:
- spare = mylist[index]
- mylist[index] = mylist[index + 1]
- mylist[index + 1] = spare
- swaps = True
- mylist = [ ]
- for count = (0,6):
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement