Pls Pls Pls make sure that you read all info below. Thank you. PYTHON Please use
ID: 661466 • Letter: P
Question
Pls Pls Pls make sure that you read all info below. Thank you.
PYTHON
Please use python!
Creat a program called difference.py that asks the user for two files and displays the differences between the characters in each file.
1. Your program should ask the user for the path to two different files.
2. For every character that is in the same position in each file but is different between the two files your program should display the index of those characters (starting from 0) as well as the value of those two characters.
3. If one file is longer than the other one, your program should report the index of each of the characters as well as the fact that it could not find a matching character
Examples:
Assume exl.txt contains the contents: "batman" and ex2.txt contains the contents "bitman" and ex3.txt contains the contents "backmans". Enter the name of the first file: ex1.txt Enter the name of the second file: ex2.txt Mismatch at character 1 a ! = i Enter the name of the first file: ex2.txt Enter the name of the second file: ex1.txt Mismatch at character1 i ! = a Enter the name of the first file: ex1.txt Enter the name of the second file: ex3.txt Mismatch at character 2 t ! = c Mismatch at character 3 m ! = k Mismatch at character 4 a ! = m Mismatch at character 5 n ! = a Mismatch at character 6 ! = n No matching character for character 7 (s) found in ex3.txt. No matching character for character 8 () found in ex3.txt. Enter the name of the first file: ex3.txt Enter the name of the second file: ex1.txt Mismatch at character 2 c != t Mismatch at character 3 k != m Mismatch at character 4 m != a Mismatch at character 5 a != n Mismatch at character 6 n ! = No matching character for character 7 (s) found in ex3.txt. No matching character for character 8 () found in ex3.txt.Explanation / Answer
file0 = open("C:path\a.txt","r")
if char1 is None:
if char2 is None: