我试图用 zip 函数和循环来解决这个问题:
mat_C=[[] for i in range(NO_OF_ROWS_C)]
for i in range(NO_OF_ROWS_C):
for j in range(NO_OF_COLUMNS_C):
mat_C=[a+b for (a,b) in zip(mat_A,mat_B)]
for i in range(NO_OF_ROWS_C):
for j in range(NO_OF_COLUMNS_C):
print(mat_C[i][j])