Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- li = [7,3,4,9,0,1,8,2,5,6]
- for x in range(len(li) - 1):
- if li[x] > li[x + 1]:
- temp = li[x + 1]
- for y in range(x, -1, -1):
- if li[y] <= temp:
- break
- li[y + 1] = li[y]
- li[y] = temp # unindent 1 level to see the bug in action
- print(li)
- input()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement