def quicksort(array):
    _quicksort(array, 0, len(array) - 1)

def _quicksort(array, start, stop):
    if stop - start > 0:
        pivot, left, right = array[start], start, stop
while left <= right:
    while array[left] < pivot:
        left += 1
while array[right] > pivot:
    right -= 1
if left <= right:
    array[left], array[right] = array[right], array[left]
Quicksort implementation in Python