For learning reason, you can create 2d array ~ matrix in in one row like:
matrix2 = [[0[[vc + v*10*vr for vc in range(0, v)] for vr in range(0, r)] Since python is a funcational language, for learning reason, you can define a map/ reduce over matrix like:
def map(matrix, r,c, fn,summ): for vr in range(0, r): for vc in range(0, c): fn(matrix[r][c],summ) or with additional map-reduce over the row:
def map(matrix, r,c, fn,fnRow,startVal,summ): for vr in range(0, r): summRow = startVal for vc in range(0, c): fn(matrix[r][c],summRow) fnRow(summRow, summ) for learning reason you could implement Strassen matrix multiplication algorithm (google please), not naive one. I doubt you learn something like that.
For doing real project, use Numpy for initiations, not for high-performance operations.