# Author: James Tam # Versions: # October 13, 2025: each element set to current value of 'r' rather than from the user. # Original, November 21, 2022 # Learning objective: creating a variable sized 2D list using 2 calls to # 'append': # 1) First append adds an empty row to the list (line 13) # 2) Second append adds sucessive elements to the newly created row (line 16) aGrid = [] noRows = int(input("Number rows: ")) noColumns = int(input("Number columns: ")) #Create list for r in range (0,noRows,1): aGrid.append ([]) for c in range (0,noColumns,1): element = r aGrid[r].append(element) #Display list for r in range (0,noRows,1): for c in range (0,noColumns,1): print(aGrid[r][c], end="") print()