input: Write a python function to implement quick sort.
  assert quick_sort([8, 5, 4, 7, 3, 1]) == [1, 3, 4, 5, 7, 8]
  assert quick_sort([10, -2, 5, 0, 6, 11, -3]) == [-3, -2, 0, 5, 6, 10, 11]
  assert quick_sort([3, 3, 3, 3, 3]) == [3, 3, 3, 3, 3]
output: def quick_sort(arr):
      if len(arr) <= 1:
          return arr
      pivot = arr[len(arr) // 2]
      left = [x for x in arr if x < pivot]
      middle = [x for x in arr if x == pivot]
      right = [x for x in arr if x > pivot]
      return quick_sort(left) + middle + quick_sort(right)