To write a python program for copying the contents from one file to another file.
PC Anaconda - Python 3.7
Open the file f1 in read mode.
Open the file f2 in append mode.
Copy the contents using write() with the for loop.
End the program.
#Developed By: PAVANA G
#Register No: 212222230105
with open('f1.txt','r') as f1:
with open ('f2.txt','a') as f2:
for line in f1:
f2.write(line)
Thus the program is written to copy the contents from one file to another file.