To write a python program for copying the contents from one file to another file.
PC Anaconda - Python 3.7
Start the program
Open file1.txt in read mode
aasign paar to fp.read() of file1.txt
again open a new file file2.txt in write mode
use write function to copy the file contents
End the program
'''
Developed by Sithi hajara
Reference number:21500125
'''
with open ("text.txt") as fp:
with open("file.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.