I\'m trying to write a function that adds two matrices to pass the following doctests:
>>> a = [[1, 2], [3, 4]] >>> b = [[2, 2], [2, 2]
def addM(a, b): res = [] for i in range(len(a)): row = [] for j in range(len(a[0])): row.append(a[i][j]+b[i][j]) res.append(row) return res