短い解決策:
>>> l
['Kevin', 'went', 'to', 'his', 'computer.', 'He', 'sat', 'down.', 'He', 'fell', 'asleep.']
>>> print ' '.join(l)
Kevin went to his computer. He sat down. He fell asleep.
>>> print ' '.join(l).replace('. ', '.\n')
Kevin went to his computer.
He sat down.
He fell asleep.
単語の末尾のピリオドのみが改行をトリガーするようにしたい場合の長い解決策:
>>> l
['Mr. Smith', 'went', 'to', 'his', 'computer.', 'He', 'sat', 'down.', 'He', 'fell', 'asleep.']
>>> def sentences(words):
... sentence = []
...
... for word in words:
... sentence.append(word)
...
... if word.endswith('.'):
... yield sentence
... sentence = []
...
... if sentence:
... yield sentence
...
>>> print '\n'.join(' '.join(s) for s in sentences(l))
Mr. Smith went to his computer.
He sat down.
He fell asleep.