def dotprod(u,v):
    """
    Simple dot (scalar) product of two lists of numbers (assumed to be the same length)
    """
    result = 0.0
    for i in range (0,len(u)):
        result = result + (u[i]*v[i])
    return result