number = 1 rows = int(input("How many rows? ")) columns = int(input("How many columns? ")) print() for rows in range (1,rows+1): line = "" for columns in range (1, columns+1): line = line + str(number) + " " number = number + 1 print(line) print() print(rows * columns, "cells generated")