Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lista = [10,5,1,4,2,16,6]
- def bubblesort(l):
- n = len(l)
- for i in range(n-1):
- print(l)
- for j in range(n-i-1):
- if l[j] > l[j+1]:
- temp = l[j+1]
- l[j+1] = l[j]
- l[j] = temp
- bubblesort(lista)
- print(lista)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement