>>> test1 = ["aaa","bbb","aaa","ccc","aaa","aaa","ddd","aaa","ccc"]
>>> test1.index("aaa") ## 返回元素的首个索引
0
>>> test1.index("bbb")
1
>>> test1.index("ccc")
3
>>> test1.count("aaa")
5
>>> a = test1.count("aaa")
>>> b = -1
>>> for i in range(a): ## 返回元素的所有索引
b = test1.index("aaa",b+1,len(test1))
print("aaa:",b)
aaa: 0
aaa: 2
aaa: 4
aaa: 5
aaa: 7
>>> test1
['aaa', 'bbb', 'aaa', 'ccc', 'aaa', 'aaa', 'ddd', 'aaa', 'ccc']