def dfs(i,j): dx=[0,0,-1,1] dy=[-1,1,0,0] if i==m-1 and j==n-1: for pos in route: print('('+str(pos[0])+','+str(pos[1])+')') for k in range(4): x=i+dx[k] y=j+dy[k] if x>=0 and x<m and y>=0 and y<n and map1[x][y]==0: ...