bubble sort
def bubble_sort(lst):
sorted_ = False
while not sorted_:
sorted_ = True
for i in range(len(lst) - 1):
print(*lst)
print(' ' * i + '^ ^')
if lst[i] > lst[i + 1]:
sorted_ = False
lst[i], lst[i + 1] = lst[i + 1], lst[i]
print(*lst)
print(' ' * i + '^ ^')
bubble_sort([1, 3, 2, 5, 4, 8, 9, 7, 6, 0])INFO