📌  相关文章
📜  python 获取二维列表中项目的索引 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:07.550000             🧑  作者: Mango

代码示例1
myList = [[1, 2], [3, 4], [5, 6]]


def index_2d(myList, v):
    for i, x in enumerate(myList):
        if v in x:
            return i, x.index(v)


print(index_2d(myList, 3))
# you get
# (1, 0)