def dot(u, v):
    """
    Returns the dot product of two vectors u, v.
    The vectors u, v are lists.
    """
    if len(u) != len(v):
        print ("Vector Dot Product Dimension Error:", len(u), ",", len(v))
    else:
        return sum([u[i] * v[i] for i in range(len(u))])