Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def multiply_matrices(a,b):
- wa, ha, wb, hb = len(a[0]), len(a),len(b[0]), len(b)
- assert wa == hb
- for row in range(ha):
- yield [sum(map(lambda x,y:x*y[col], a[row], b)) for col in range(wb)]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement