# Author: James Tam # Veersion: 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 ([]) print(aGrid) for c in range (0,noColumns,1): #element = input("Type in a single character: ") aGrid.append("*") print(aGrid) print(len(aGrid)) print(len(aGrid[0])) print(aGrid) #Display list for r in range (0,noRows,1): for c in range (0,noColumns,1): print(aGrid[r][c], end="") print()