input: 
  from typing import List, Optional
  
  
  def binary_search(arr: List[int], target: int) -> Optional[int]:
      """
      Performs a binary search on a sorted list of integers to find the index of the target element.
      If the target element is not found, returns None.
  
      >>> binary_search([1, 2, 3, 4, 5], 3)
      2
      >>> binary_search([1, 2, 3, 4, 5], 6)
      None
      """
      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
  
output:     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