# TODO 计算矩阵乘法 AB,如果无法相乘则raise ValueError
def matxMultiply(A, B):
multiply = []
if len(A[0]) != len(B):
raise ValueError
result = [list(row) for row in zip(*B)]
for Al in range(len(A)):
row =[]
for Bl in range(len(result)):
num = 0
for Br in range(len(result[0])):
num += A[Al][Br] * result[Bl][Br]
row.append(num)
multiply.append(row)
return multiply