This is the list of strings that I have:
[
['It', 'was', 'the', 'besst', 'of', 'times,'],
['it', 'was', 'teh', 'worst', 'of', 'times']
]
I need to split the punctuation in times,
, to be 'times',','
or another example if I have Why?!?
I would need it to be 'Why','?!?'
import string
def punctuation(string):
for word in string:
if word contains (string.punctuation):
word.split()
I know it isn't in python language at all! but that's what I want it to do.