"" "
Sort the elements of a list in ascending order
"" "
#ordenação bolha
#L = [5,3,1,2,4]
L = [7,4,3,12,8]
x = 0
while x < (len(L) -1):
if L[x] > L[x+1]:
L[x],L[x+1] = L[x+1],L[x]
x += 1
print(L)
Output: [4, 3, 7, 8, 12]...
asked by
25.03.2018 / 19:24