To write a python program for copying the contents from one file to another file.
PC Anaconda - Python 3.7
use open function to open the file in which we want to copy from and access it in read mode
read the file and store in a variable
now create a new file in which we want to paste the content using write access mode
use write function to copy the read file that has been stored in variable
the content in orginal file will be copied in new file
end the program
Devloped by : M Nikhil
Register number : 22008584
with open("sample1.txt","r")as firstfile:
with open("sample2.txt","a")as second file:
for line firstfile:
secondfile.write(line)
Thus the program is written to copy the contents from one file to another file.