Problem Solving Using Binary Search Python