I am trying to writing the algorithm for quick sort in python but I am not getting the correct output.
I am taking the array through user input.

This is my code.

```
def partition(arr, low, high):
    pivot = arr[low]
    i = low
    j = high

    while i < j:
        while arr[i] <= pivot: i = i+1
        while arr[j] > pivot: j = j-1
        if i < j:
            arr[i], arr[j] = arr[j], arr[i]

    if i > j:
        arr[j], arr[low] = arr[low], arr[j]
        return j

    def quickSort(arr, low, high):
        if low < high:
            pivot = partition(arr, low, high)
            quickSort(arr, low, pivot-1)
            quickSort(arr, pivot+1, high)

    a = []
    n = int(input("Enter the number of elements : "))
    print("Enter the elements now")
    for i in range(0, n):
        element = int(input())
        a.append(element)

    print("Given array :", a)
    l = len(a)

    quickSort(a, a[0], a[l-1])
    print("Sorted array is :", a)

```