删除二维坐标系中的路径(python)

2024-04-19 00:23:02 发布

您现在位置:Python中文网/ 问答频道 /正文

只是一个简单,快速的问题:我必须写一个函数delete(path,field),它将删除坐标系中的路径。函数没有返回任何内容,它只重新生成字段。到目前为止,我做到了:

def delete(path,field)
    for x,y in path:
        #this is where i got stuck, i dont know how to rename field[x][y] (coordinate) into somethin else, lets say '-'
    for column in field:
        for element in column:
            if element=='-'
                column.remove(element)

如果我知道如何在特定坐标处重命名元素,我想这个函数会起作用。你知道吗


Tags: path函数in路径field内容foris