m = m1[:]
for i in range(len(m)):
    for j in range(len(m[i])):
        m[i][j] = m1[i][j] * m2[i][j]
return m
m = [[1, 2, 3], [4, 5, 6]]
assert [[1 * 1, 2 * 2, 3 * 3], [4 * 4, 5 * 5, 6 * 6]] == pw(m, m)
поэлементные операции над матрицей в python