tag = 'o'
maze[y, x] = tag
if self.solve(x + 1, y) == True:
    tag = '>'
elif self.solve(x, y + 1) == True:
    tag = 'v'
elif self.solve(x - 1, y) == True:
    tag = '<'
elif self.solve(x, y - 1) == True:
    tag = '^'
else:
    tag = ' '
maze[y, x] = tag
return tag != ' '
Maze solving with python