def unrolled_matvec(mat, x):
    'Apply a Python list of lists of scalars to a list of scalars.'
    result = []
    for i in range(len(mat)):
        v = 0
        for j in range(len(x)):
            if (mat[i][j] is not None):
                v += (mat[i][j] * x[j])
        result.append(v)
    return result
Apply a Python list of lists of scalars to a list of scalars.
def unrolled_matvec(mat, x):
    
    result = []
    for i in range(len(mat)):
        v = 0
        for j in range(len(x)):
            if (mat[i][j] is not None):
                v += (mat[i][j] * x[j])
        result.append(v)
    return result