title: Python QuickSort only partially sorting
body: <p>I'm learning the quicksort algorithm, but for some reason, the output of this python implementation is just partially sorted, and I get the 'maximum recursion depth reached' for larger inputs. I've been banging my head against this for the last couple of days and I know it's probably something really stupid, but I can't seem to figure it out, so I'll appreciate any help. </p>
  
  <pre><code>def ChoosePivot(list):
      return list[0]  
  
  def Partition(A,left,right):
      p = ChoosePivot(A)
      i = left + 1
  
      for j in range(left + 1,right + 1): #upto right + 1 because of range()
          if A[j] &lt; p:
                  A[j], A[i] = A[i], A[j] #swap
                  i = i + 1
      A[left], A[i - 1] = A[i-1], A[left] #swap
      return i - 1
  
  def QuickSort(list,left, right):
      if len(list) == 1: return   
      if left &lt; right:
          pivot = Partition(list,left,right)              
          QuickSort(list,left, pivot - 1)
          QuickSort(list,pivot + 1, right)
          return list[:pivot] + [list[pivot]] + list[pivot+1:]
  
  sample_array = [39,2,41,95,44,8,7,6,9,10,34,56,75,100] 
  print "Unsorted list: " 
  print sample_array
  sample_array = QuickSort(sample_array,0,len(sample_array)-1)
  print "Sorted list:"
  print sample_array
  </code></pre>