input: Write a function to calculate the dot product of two lists. The function should take two arguments in the form of lists and return the dot product. If the given lists are of different lengths, the function should raise a ValueError.
  assert dot_product([1, 2], [3, 4])==11
  assert dot_product([1, 2, 3], [4, 5, 6])==32
  assert dot_product([], [])==0
  try:
      dot_product([1, 2], [3, 4, 5])
  except ValueError:
      pass
  else:
      raise AssertionError("Expected ValueError for lists of different lengths")
output: def dot_product(list1, list2):
      if len(list1) != len(list2):
          raise ValueError("Lists must be of the same length")
      return sum(x * y for x, y in zip(list1, list2))