天天看点

python 返回列表中某个值的索引

list = [5,6,7,9,1,4,3,2,10]

list.index(9)

out:3

同时可以返回列表中最大值的索引list.index(max(list))

最小值索引list.index(min(list))