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 it in a variable
now create a file in which we want topaste the content using write acces mode
use write function to copy the read file that has been stotred in the varible
The content in the original file will be copied in the new file
End the program
with open("Files.txt","r") as f1: with open("copy.txt","w") as f2: line = f1.read() f2.write(line)
Thus the program is written to copy the contents from one file to another file.