This is my implementation of Quick Sort Algorithm :
def quick_sort(sequence): if len(sequence)<= 1: return sequence else: pivot = sequence.pop() # To take the last item of "sequence" list greater =[] lower = [] for n in sequence: if n > pivot : greater.append(n) else: lower.append(n) """ return the quiqk sorted "lower" and "greater" lists ,and pivot as a list in between """ return quick_sort[lower] + [pivot] + quick_sort[greater]
How can I improve it ?