Programming Examples
Python program to copy the one contents to another
Write a python program to copy all the contents of text file Mango.txt into a empty file Orange.txt
Solution
fp=open("mango.txt","r")
data=fp.read()
fp1=open("orange.txt","w")
fp1.write(data)
print("data copied")
fp.close()
fp1.close()
Output/ Explanation:
data copied