I have a text file:
But soft what light through yonder window breaks It is the east and Juliet is the sun Arise fair sun and kill the envious moon Who is already
output = [] with open('file_name') as f: for i in f.readlines(): for j in words_to_split: i = ''.join(i.split(j)) output.append(i)