Run
rows = 3 cols = 4 matrix = [[x*y for x in range(cols)] for y in range(rows)] for row in matrix: print(row)
Output