Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. I have two years left for my school to end.
  2. I have four apples at home. My school sucks but it is the second best school in town.
  3.  
  4. I have three years left for my school to end.
  5. I have four apples at home. My school sucks but it is the second best school in town.
  6.  
  7. txt = 'I have two years left for my school to end.
  8. 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.
  9. I have four apples at home. My school sucks but it is the second best school in town.'
  10. words = 'school'.split(' ')
  11. sentences = re.findall(r"([^.]*.)" ,txt)
  12. for sentence in sentences:
  13. if any(word in sentence for word in words):
  14. print(sentence.split('n'))
  15.  
  16. two
  17. three
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement