To write a python program for copying the contents from one file to another file.
PC Anaconda - Python 3.7
Open the first text file and read it.
After that open the second text file and append the first one to it.
Start the for loop.
Then write the lines from the first one to the second file using the write function.
Print the output
with open("text.txt") as f: with open("text1.txt","w") as f1: for line in f: f1.write(line)
Thus the program is written to copy the contents from one file to another file.