0
如果我有這條線提取物什麼的線路是兩個詞之間
"he is a good man and he goes every day to a school"
我想檢測一下兩個詞「他」,「和」,這樣的輸出將是
is a good man
我想這
for line in file:
print line[line.index('he'): line.index('and')]
此代碼使輸出
he is a good man
我怎麼能這樣做?