天天看點

python 傳回清單中某個值的索引

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

list.index(9)

out:3

同時可以傳回清單中最大值的索引list.index(max(list))

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