获取列表中多个相同元素的索引值

>>> a = ['a','b','c','a','c'] >>> for item in enumerate(a): if item[1] == 'a': print item[0] 0 3 >>>
相关文章
相关标签/搜索