def dot_product(u, v):
    """Computes the dot product of two vectors u and v, each represented 
    as a tuple or list of coordinates. Assume the two vectors are the
    same length."""
    product = 0
    for n in range(len(u)):
        product += u[n]*v[n]
    return product