Here is a .txt file (semi colon signifies start of file):
MiddlePhrase.txt:
coke and cheeseburgers
bread and wine
beer and tacos
Here is the code I have now:
middlePhrases = open('MiddlePhrase.txt', 'r')
firstPhrase = 'I love to drink and eat '
secondPhrase = ' when I am at the beach!'
for i in middlePhrases:
print(beginningPhrase,{},endPhrase)
The goal is to write the first line of 'MiddlePhrase.txt' to a new .txt file named 'NewPhraseFile.txt', then append the following two lines in 'MiddlePhrase.txt' to the 'NewPhraseFile.txt'
This is the desired output (a new .txt file being written with content):
NewPhraseFile.txt:
I love to drink and eat coke and cheeseburgers when I am at the beach!
I love to drink and eat bread and wine when I am at the beach!
I love to drink and eat beer and tacos when I am at the beach!