input: Write a function to calculate the dot product of two lists and return the result. The function should take two lists as arguments, perform the dot product operation, and return the resulting value. If the input lists are empty, the function should return 0.
  assert dot_product([1, 2], [3, 4]) == 11
  assert dot_product([2, 3, 4], [5, 6, 7]) == 56
  assert dot_product([1], [10]) == 10
  assert dot_product([], []) == 0
  assert dot_product([1, 2, 3], [4, 5]) == 0  # Lists of different lengths, invalid input
  assert dot_product([-1, -2, -3], [-4, -5, -6]) == 32
output: def dot_product(list1, list2):
      if len(list1) != len(list2):
          return 0
      return sum(x * y for x, y in zip(list1, list2))