input: Write a function to perform binary search on a sorted list.
  assert binary_search([1, 3, 5, 7, 9], 3) == 1
  assert binary_search([2, 4, 6, 8, 10], 6) == 2
  assert binary_search([10, 20, 30, 40, 50], 35) == None
output: def binary_search(arr, target):
      left, right = 0, len(arr) - 1
      while left <= right:
          mid = (left + right) // 2
          if arr[mid] == target:
              return mid
          elif arr[mid] < target:
              left = mid + 1
          else:
              right = mid - 1
      return None