fork(1) download
  1. import re
  2.  
  3. text1 = "This has four words"
  4. text2 = "This has three"
  5.  
  6. # Let's say sentences with at least 4 words pass.
  7.  
  8. words1 = re.split(r"\s+", text1)
  9. words2 = re.split(r"\s+", text2)
  10.  
  11. if len(words1) > 3:
  12. print("text1 Pass")
  13. else:
  14. print("text1 Fail")
  15.  
  16. if len(words2) > 3:
  17. print("text2 Pass")
  18. else:
  19. print("text2 Fail")
Success #stdin #stdout 0.03s 9440KB
stdin
Standard input is empty
stdout
text1 Pass
text2 Fail