Write a program that creates and stores a scalable Z, then prints it. Do this twice: 1. Using a list of lists for storage in your implementation. 2. Using a dictionary for storage in your implementation. Here's the starting point: size = int(raw_input("Size: ")) for line in range(size): for column in range(size): if line == 0 or line == size-1 or line+column == size-1 or \ line == size/2 and size/4 < column < 3 * size/4: print "*", else: print " ", print We then wrote these: def show(matrix): for line in range(len(matrix)): for column in range(len(matrix[line])): print matrix[line][column], print def generate(columns, lines): matrix = [] for line in range(lines): row = [] for column in range(columns): row.append(' ') matrix.append(row) return matrix def setZ(matrix): size = len(matrix) for line in range(size): for column in range(size): if line == 0 or line == size-1 or line+column == size-1 or \ line == size/2 and size/4 < column < 3 * size/4: matrix[line][column] = "*" else: matrix[line][column] = " " size = int(raw_input("Size: ")) board = generate(size, size) setZ(board) show(board) We then changed the representation and the new code became: def show(matrix): for line in range(matrix["height"]): for column in range(matrix["width"]): print matrix[line, column], print def generate(columns, lines): matrix = {} matrix["height"] = lines matrix["width"] = columns for line in range(lines): for column in range(columns): matrix[line, column] = '*' return matrix def setZ(matrix): size = matrix["width"] for line in range(size): for column in range(size): if line == 0 or line == size-1 or line+column == size-1 or \ line == size/2 and size/4 < column < 3 * size/4: matrix[line, column] = "*" else: matrix[line, column] = " " size = int(raw_input("Size: ")) board = generate(size, size) setZ(board) show(board) Notice that the "main program" that is, the last four lines, are representation independent. That is, the generate, show and setZ functions hide the internal representation from their users.