📌  相关文章
📜  如何在python代码示例中获取字符串的所有索引

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

代码示例1
word = 'Hello'
to_find = 'l'

# in one line
print([i for i, x in enumerate(word) if x == to_find])