Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ordenação bolha
- L = [5,3,1,2,4]
- #L = [7,4,3,12,8]
- x = 0
- ordenado = False
- while not ordenado:
- ordenado = True
- while x < (len(L) -1):
- if L[x] > L[x+1]:
- ordenado = False
- L[x],L[x+1] = L[x+1],L[x]
- print(L)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement