#Algoritimo Bubblesort lista = [8, 10, 39, 90,34, 67, 2, 45, 6, 1, 4] # list to sort swapped = True # it's a little fake - we need it to enter the while loop while swapped: swapped = False # no swaps so far for i in range(len(lista) - 1): if lista[i] > lista[i + 1]: swapped = True # swap occured! lista[i], lista[i + 1] = lista[i + 1], lista[i] print(lista)