📅  最后修改于: 2022-03-11 14:48:10.494000             🧑  作者: Mango
import re
sentence = input("Give me a sentence ")
word = input("What word would you like to find ")
for match in re.finditer(word, sentence):
print (match.start(), match.end())