📜  查找大于 python 代码示例的值的索引

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

代码示例1
>>> [i for i,v in enumerate(a) if v > 4]
[4, 5, 6, 7, 8]
#enumerate returns the index and value of each item in an array. 
#So if the value v is greater than 4, include the index i in the new array.