# 深度搜索dfs 会返回所有的路径,然后用一个数组保存这些路径,再找到最少的 def DFS(x,y): if x == row-1 and y == col - 1: temp.extend(route) #不知道 为什么temp.append(route)不行,只保存第一个项 return for i,j in [[0,-1],[0,1],[-1,0],[1,0]]: temp_x = x+i temp_y = y+j if temp_x in range(row) and temp_y in range(col) and maze[temp_x][temp_y] == '0': maz...