title: how to make my maze function print out the solution
body: <p>I am working on a maze solution problem. After the code can find the Goal, I could not let the python print out a list of solution. But It's required for homework.</p>
  
  <p>Can somebody help me? I just learned python for 3 weeks. I want to print out the every step python goes toward the Final Goal. Here is my code:</p>
  
  <pre><code>def mazeDetector(row,col):
      c= m[row][col]
      solution=[]
  
      if c =="W":
          print "Wall here: "+ str(row)+ ","+ str(col)
          return False
      elif c =="V":
          print "Visited: " + str(row)+ ","+ str(col)
          return False
      elif c=="F":
          print "Found: "+ str(row)+ ","+ str(col)
          print solution
          return True
  
      print "visiting:"+ str(row)+ ","+ str(col) 
      solution.append((row,col),)
      m[row][col]=="V"
      if (col&gt;0 and mazeDetector(row,col-1)):
          return True
      elif (row&lt; len(m)-1 and mazeDetector(row+1,col)):
          return True
      elif (row&gt;0 and mazeDetector(row-1, col)):
          return True
      elif (col&lt;=len(m)-1 and mazeDetector(row, col+1)):
          return True
      return False
  mazeDetector(1,5)
  </code></pre>
  
  <p>And here is the maze, <code>W</code> means wall, <code>P</code> means place to go, <code>S</code> means start, <code>F</code> means final:</p>
  
  <pre><code>[['W', 'P', 'P', 'W', 'W', 'W'], 
   ['W', 'W', 'P', 'W', 'P', 'S'], 
   ['W', 'W', 'P', 'W', 'P', 'W'], 
   ['P', 'P', 'P', 'P', 'P', 'W'], 
   ['F', 'W', 'P', 'W', 'W', 'W'], 
   ['W', 'P', 'P', 'P', 'P', 'W']]
  </code></pre>