code: def binary_search(data, target, lo=0, hi=None):
      hi = hi if hi is not None else len(data)
      mid = (lo + hi) // 2
      if hi < 2 or hi > len(data) or target > data[-1] or target < data[0]:
          return -1
      if data[mid] > target:
          return binary_search(data, target, lo=lo, hi=mid)
      elif data[mid] < target:
          return binary_search(data, target, lo=(mid + 1), hi=hi)
      elif data[mid] == target:
          return mid