title: My lower bound binary search function acts like an upper bound binary search function
body: <p>This is my code:</p>
  <pre><code>def lowbound(num,alist): 
      low = 0
      high = len(alist)-1
      while low &lt; high:
          mid = (high+low)//2
          if num &lt;= alist[mid]:
              high = mid
          else:
              low = mid + 1
      return low
  print(lowbound(4,[1,3,5,7,9]))
  </code></pre>
  <p>When I run this, I get 2. How can I make the function such that I get 1, which is the index below the value I'm looking for?</p>