# This function reads a maze file, filename, and creates a maze, m. # Please declare "m" as a list before calling the function and then pass it in. def readMaze(m, filename): mazeFile = open(filename, "r") lines = mazeFile.readlines() for line in lines: line = line.strip() row = [c for c in line] m.append(row) m = [] # This declares the maze as an empty list readMaze(m, "sampleMaze.txt") # This reads the maze into the list print m # This prints the maze, showing it with the usual notation as a "list of lists"