def addrow(row1, row2, K):
 return [(element1 + element2) for (element1, element2) in zip(row1, row2)]

def addrow ( row1 , row2 , K ) : return [ ( element1 + element2 ) for ( element1 , element2 ) in zip ( row1 , row2 ) ]
adds two rows of a matrix element-wise .