Загрузка данных


def quicksort(arr):
    if len(arr) < 2:
        arr
    pivot = arr[0]
    less = []
    greater = []
    for x in arr:
        if x <= pivot:
            less.append(x)
        else:
            greater.append(x)
    return quicksort(less) + pivot + quicksort(greater)

print(quicksort([5, 2, 8, 4, 9, 1]))