title: Implement binary search subroutine but no outcome
body: <p>Details of the algorithm:</p>
  <p>Given an array A of n elements with sorted values <code>A[0] ≤ A[1] ≤ ... ≤ A[n−1]</code>, and target value x, the following subroutine uses binary search to find the index of x in A.</p>
  <p>Here is the code I wrote:</p>
  <pre class="lang-py prettyprint-override"><code>def Binarysearch(A, x): 
      L = 0 
      R = len(A)-1 
      M = (L + R)//2 
      while L&lt;=R: 
          if A[M] &lt; x: 
              L = M+1 
          elif A[M] &gt; x: 
              R = M-1 
          else: 
              return M 
      
      return None 
  </code></pre>
  <p>PROBLEM:
  By writing the following lines I get no outcome:</p>
  <pre class="lang-py prettyprint-override"><code>list = [2,3,4,5,12,15,76]
  Binarysearch(list, 3)
  </code></pre>
  <p>I would like to understand what is the problem.
  I noticed that if I substitute after the else condition: return M with print(M) I get an infinite sequence of 1.</p>