import random import numpy as np size = int(input("Enter a size:")) rows = cols = size #Generate a 2D array ''' first = [] for i in range(cols): second = [] for j in range(rows): second.append(j) first.append(second) print(first) ''' one = np.full((rows,cols),0) two = np.full((rows,cols),0) one[0][0] = 1 one[0][1] = 2 one[0][2] = 3 def print_matrix(mat): for y in range(0,len(mat)): for x in range(0,len(mat)): if (mat[y][x] == 1): print("#",end="") elif (mat[y][x] == 2): print("$",end="") else: print(".",end="") print() for y in range(0,rows): for x in range(0,cols): one[y][x] = random.randint(0,2) two[y][x] = random.randint(0,2) print_matrix(one) print() print_matrix(two) print()