To write a python program for copying the contents from one file to another file.
PC Anaconda - Python 3.7
Open the first file in read mode
Open the second file in append mode
Every word in first file is copied to second file using write()
close the first file
close the second file
python program for copying the contents from one file to another file.
Developed by: Mathiyazhagan.A
RegisterNumber: 22005215
f1=open("sample1.txt","r")
f2=open("sample2.txt","a")
for line in f1:
f2.write(line)
f1.close()
f2.close()
Thus the program is written to copy the contents from one file to another file.