title: On execution of following program I'm getting this error Line 11 if list[mid]<n: IndentationError: expected an indented block
body: <p>pos = -1</p>
  <p>def search(list, n):</p>
  <pre><code>l = 0
  u = len(list)-1
  
  while l &lt;= u:
      mid = (l+u) // 2
  
      if list[mid] == n:
          globals()['pos'] = mid
          return True
      else:
          if list[mid] &lt; n:
              l = mid+1;
          else:
              u = mid-1;
  
  return False
  </code></pre>
  <p>list = [4,7,8,12,45,99,102,702,10987,56666]
  n = 10</p>
  <p>if search(list, n):
  print(&quot;Found at &quot;,pos+1)
  else:
  print(&quot;Not Found&quot;)</p>