I\'ve made a list of lists from a text block where each list contains all the words in a line as a separate element, like this:
listoflists = [[\'Lorem\', \'ipsu
listoflists = [['Lorem', 'ipsum', 'dolor', 'sit', 'amet\n'],['consectetur', 'adipiscing', 'elit', 'donec', 'iaculis\n']]
for l in listoflists:
l[-1] = l[-1].replace('\n','')
print listoflists
""" Output:
[['Lorem', 'ipsum', 'dolor', 'sit', 'amet'], ['consectetur', 'adipiscing', 'elit', 'donec', 'iaculis']]
"""