To write a python program for copying the contents from one file to another file.
PC Anaconda - Python 3.7
Create a text file with some written information
Open the text file with open()
Open the empty text file to copy the information
By using the function write() copy the text written in the file1 to file2
End the program
with open("file.txt") as fp: with open("file2.txt","w") as fp1: line=fp.read() fp1.write(line)
Thus the program is written to copy the contents from one file to another file.