def dot_product(A, B):
    """
    Computes the dot product of vectors A and B.

    @type A: vector
    @type B: vector

    @rtype: number
    @return: dot product of A and B
    """
    if len(A) != len(B):
        raise ValueError("Length of operands do not match")

    result = 0.0

    for i, v in enumerate(A):
        result += A[i] * B[i]

    return result