Question: Python 3 Write a function named mergeFiles(). Takes in 3 inputs, the path to two source files and a path to a new file. The

Python 3
Write a function named mergeFiles(). Takes in 3 inputs, the path to two source files and a path to a new file. The function takes the content of the first and second file and merges them into the 3rd file. All exceptions must be caught (FileNotFoundError, IOError etc). Result is the file written with the contents of the two other files: Page 5 of 7 out - Notepad File Edit Format View Help This is the contents of file 1. This is the contents of file 2. >>> mergeFiles('1.txt','2.txt','out.txt') >>> mergeFiles('A.txt', '2.txt','out.txt') One of the two files could not be found > |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
