Binary search of a number within a list in Python
<p>I was researching about  binary search of a number within a list and came across <a href="https://stackoverflow.com/questions/212358/binary-search-bisection-in-python">this discussion</a></p>

<p>Somewhere else I it was mentioned about going for even and odd numbered list separately. But is that language specific? The information is little confusing.</p>

<p>For Binary search , I know high-level I need to carry out following steps,</p>

<ul>
<li>sort the list in ascending order    </li>
<li>Check for middle item within a list  if thats the number we are done</li>
<li>if not , if the number is  greater  than the middle number, get rid of lower half  </li>
<li>if searched  number is lower than middle number , get rid of uppeer half   </li>
<li>keep repeating until number is found</li>
</ul>

<p>The list can be ascending or descending order and can be of <code>float</code> of <code>int</code> numbers.
what's pythonic way of carrying out above pseudocode?
I am using python 2.7.x on windows.</p>

<p>**  EDIT **
The mentioned discussion does not cover even and odd list (at least I couldn't see any<br>
I would like to request more clarifications on that such as,<br>
- If I need to treat even odd list differently<br>
- Is there a way in python that will take care of that </p>