fork(7) download
  1. def getMaxNrWords(S):
  2. max_len = 0
  3. for sent in S:
  4. max_len = max(max_len, len(sent.split()))
  5. return max_len
  6.  
  7.  
  8. S = ["We test coders", "Give us a try", ""]
  9.  
  10. print getMaxNrWords(S)
Success #stdin #stdout 0.01s 9016KB
stdin
Standard input is empty
stdout
4