CBSE Class 12 Computer Science
Question 79 of 136
Data File Handling — Question 18
Back to all questionsdef copy_file(file1, file2):
with open(file1, 'r') as source:
with open(file2, 'w') as destination:
destination.write(source.read())
source_file = input("Enter the name of the source file: ")
destination_file = input("Enter the name of the destination file: ")
copy_file(source_file, destination_file)