Data structure and algorithm part 1

In 8. Implement the solution and test it using example inputs. Fix bugs, if any.

elif mid_number < query:
hi = mid - 1
elif mid_number > query:
lo = mid + 1

The < and > should be opposite, no?