To write a python program for copying the contents from one file to another file.
PC Anaconda - Python 3.7
Create a f1.txt with some content in it
Open the f1.txt file in read mode
Create a f2.txt file using write mode
Copy the content of f1.txt file to f2.txt using write function
#Developed By: BALAMURUGAN B
#Register No: 212222230016
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.