📅  最后修改于: 2022-03-11 14:45:05.054000             🧑  作者: Mango
string='mississippi'
s='s'
lst= []
for i in range(len(string)):
if (string[i] == s):
lst.append(i)
print(lst)
#result: [2, 3, 5, 6]