Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I have two years left for my school to end.
- I have four apples at home. My school sucks but it is the second best school in town.
- I have three years left for my school to end.
- I have four apples at home. My school sucks but it is the second best school in town.
- txt = 'I have two years left for my school to end.
- I have four apples at home. My school sucks but it is the second best school in town. I have three years left for my school to end.
- I have four apples at home. My school sucks but it is the second best school in town.'
- words = 'school'.split(' ')
- sentences = re.findall(r"([^.]*.)" ,txt)
- for sentence in sentences:
- if any(word in sentence for word in words):
- print(sentence.split('n'))
- two
- three
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement