Question: Write a function called file_compare(myfile, correctfile) that compares two text files line by line (you can assume that the files have the same number of
Write a function called file_compare(myfile, correctfile) that compares two text files line by line (you can assume that the files have the same number of lines). If the lines are different, the function prints out a list of the characters in the line for the first file and the corresponding line in the second file so that the user can inspect the difference. Make sure your comparison shows the blank characters i.e. space, , \t that print out as blanks on the screen if you use print(). You can then use this function to compare the output of your homework assignments to the outputs provided in the homework assignments. (Hint: you may want to use file.readlines()) Test your function against the two files provided called myfile.txt and correctfile.txt?
Has to be in python program language
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
