Python Kata: implementing binary search algorithm in python