input: Write a function that calculates the dot product of two lists provided as arguments. The function should iterate through the elements of both lists, multiply corresponding elements, and sum the result of these multiplications. If the lists are of different lengths, the function should raise a ValueError.
  
  def dot_product(list1, list2):
    if len(list1) != len(list2):
      raise ValueError("The lists must be of the same length")
    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, 0], [4, 5]) == 4
  assert dot_product([0, 0], [0, 0]) == 0
  try:
    dot_product([1, 2, 3], [4, 5])
    assert False, "Expected ValueError"
  except ValueError:
    assert True
output: def dot_product(list1, list2):
    if len(list1) != len(list2):
      raise ValueError("The lists must be of the same length")
    product = 0
    for i in range(len(list1)):
      product += (list1[i] * list2[i])
    return product