擅长:python、mysql、java
<p>如果要求返回出现该词的第一句话,可以使用类似-</p>
<pre><code>def func(strs, word):
for idx, s in enumerate(strs):
if s.find(word) != -1:
return idx
example = ['Mary had a little lamb' ,
'Jack went up the hill' ,
'Jill followed suit' ,
'i woke up suddenly' ,
'it was a really bad dream...']
func(example,"woke")
</code></pre>