title: Recursion binary search in Python
body: <p>I have a list with numbers from 0-9:</p>
  
  <pre><code>mylist = list(range(10))
  </code></pre>
  
  <p>I am getting an error with the division command to get <code>mid</code>:</p>
  
  <pre><code>def binary_search(mylist, element, low, high):
      low=0
      high= len(mylist)
      mid=low + (high- mymin)/2
      if mid==len(mylist):
          return False
      elif mylist[mid]==element:
          return mid
      elif high==low:
          return False
      elif mylist[mid]&lt;element:
          return binary_search(mylist, element, mymin, mid-1)
      elif mylist[mid]&lt;element:
          return binary_search(mylist, element, mid+1, mymax)
      else:
          return mid
  </code></pre>
  
  <p>and if I wanted to return <code>True</code> how would I write that on top of <code>return binary_search(mylist, element, mymin, mid-1)</code>?</p>