input: Write a function to calculate the dot product of two given lists. The function should take two lists as arguments and return the dot product. If the given lists are empty or of different lengths, the function should return None.
  def dot_product(list1, list2):
    if len(list1) != len(list2):
      return None
    product = 0
    for i in range(len(list1)):
      product += (list1[i] * list2[i])
    return product
  assert dot_product([1, 2], [3, 4])==11
  assert dot_product([1, 2, 3], [4, 5, 6])==32
  assert dot_product([1, 2], [3, 4, 5])==None
  assert dot_product([], [])==0
  assert dot_product([1], [2])==2
output: def dot_product(list1, list2):
    if len(list1) != len(list2):
      return None
    product = 0
    for i in range(len(list1)):
      product += (list1[i] * list2[i])
    return product