table = [12, 43, 6, 22, 37] for i in range(len(table) - 1): if table[i] > table[i+1]: table[i],table[i+1] = table[i+1], table[i]