python3多维数组如何找到元素的位置

如题所述

python3里这样:
>>>a=[1,2,3]
>>>b=2
>>> b in a
True #先判定b在a里
>>>a.index(b)
1 #b在a的位置1,数组第一个位置为0
温馨提示:答案为网友推荐,仅供参考
相似回答