I need to split strings of data using each character from string.punctuation and string.whitespace as a separator.
string.punctuation
string.whitespace
Furthermore, I need for the
from string import punctuation, whitespace s = "..test. and stuff" f = lambda s, c: s + ' ' + c + ' ' if c in punctuation else s + c l = sum([reduce(f, word).split() for word in s.split()], []) print l