def dotProduct(list1, list2):
    """
    This function determines the dot product of two lists

    :param list list1: input list 1
    :param list list2: input list 2
    :return int dp: calculated dot product (could also be type float)
    """
    # Exit function if lengths are not the same
    if len(list1) != len(list2):
        print("\nBoth input lists must have the same length\n")
        raise IndexError

    # NOTE. This function does not check that both lists only contain numbers
    # but it is expected to work properly

    L = len(list1)
    dp = 0

    for i in range(L):
        dp += list1[i] * list2[i]

    return dp