找出test_list 中字符:‘c’的索引并保存到index_list 中
test_list = ['a', 'b' , 'c', 'a', 'c', 'd']
print(list(enumerate(test_list)))
index_list = [i for i,v in enumerate(test_list) if 'c' == v]
print(index_list)
找出test_list 中字符:‘c’的索引并保存到index_list 中
test_list = ['a', 'b' , 'c', 'a', 'c', 'd']
print(list(enumerate(test_list)))
index_list = [i for i,v in enumerate(test_list) if 'c' == v]
print(index_list)