title: Quick Sort implementation in python
body: <p>I am trying to write a quick sort in place function
  here is my code</p>
  
  <pre><code>def quick_sort(ar):
      if len(ar) &lt; 2:
          return ar
      pivot = ar[-1]
      i = 0
  
      for j in range(len(ar)):
          if ar[j] &lt; pivot:
              ar[i], ar[j] = ar[j] , ar[i]
              i += 1
      ar[i], ar[-1] = ar[-1], ar[i]
  
      quick_sort(ar[0:i])
      quick_sort(ar[i+1:])
  
      return ar
  
  
  lst = [1, 3, 9, 8, 2, 7, 5]
  print quick_sort(lst)
  </code></pre>
  
  <p>but i get an empty list in return.. what I am missing here? </p>