Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '''
- Created on 21.07.2010
- @author: chaporgin_a
- '''
- a = [1,2,1,5,4,5]
- print(a)
- n = len(a)
- buff = None
- k = 0
- while k < n:
- t = k
- while t < n-1:
- if a[t] > a[t+1]:
- buff = a[t+1]
- a[t+1] = a[t]
- a[t] = buff
- t += 1
- k+=1
- print(a)
Advertisement
Add Comment
Please, Sign In to add comment