Advertisement
Redomine

re

Aug 26th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import fileinput
  2. import re
  3. strings = []
  4. for s in fileinput.input():
  5. if len(s) == 1: break
  6. strings.append(s.strip())
  7.  
  8. for string in strings:
  9. result = re.findall(r'cat', string)
  10. if (len(result) >= 2): print (string)
  11.  
  12.  
  13.  
  14.  
  15. import re
  16.  
  17. strings=[]
  18. i = True
  19. while i:
  20. i = input()
  21. if i: strings.append(i)
  22.  
  23. for string in strings:
  24. result = re.findall(r'cat', string)
  25. if (len(result) >= 2): print (string)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement