below code returns a list:
[['We test robots'], ['Give us a try'], [' ']]
now I need to count words in each element, how could I achieve this in Python without importing any packages. In the above I should get 3,4 and 1 for three list elements. thanks
import re
S ="We test robots.Give us a try? "
splitted = [l.split(',') for l in (re.split('\.|\!|\?',S)) if l]
print (splitted)