Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- numbers = [999,888,777,666,555,444]
- change = True
- def print_list(list):
- for i in list:
- print i
- def sort(list):
- global change
- change = False
- print "Sorting..."
- for i in range(0,(len(list)-1)):
- if list[i] > list[i+1]:
- temp = list[i]
- list[i] = list[i+1]
- list[i+1] = temp
- change = True
- print_list(numbers)
- while change:
- sort(numbers)
- print_list(numbers)
Add Comment
Please, Sign In to add comment