Programming Examples
Python program to marge the content of target file into source file
Write a Python program to accept two file name (source and Target) and copy and append the content of target file into source file.
Solution
fname1=input("Enter the Source File Name : ")
fname2=input("Enter the Target File Name : ")
fp1=open(fname1,"a")
fp2=open(fname2,"r")
data=fp2.read()
fp1.write(data)
fp1.close()
fp2.close()
Output