Here's my sample code for my intro to binary search in Python and Java.
Click below to download:
binary_search.py
TestBinarySearch.java