Write a script named dif.py. This script should prompt the This is text. Comparing files that are different: user for the names of two text files and compare the abc contents of the two files to see if they are the same. 123 1. If they are, the script should simply output "Yes". Enter the first file name: one.txt differentFromOne.txt 2. If they are not, the script should output "No", Enter the second file name: differentFromOne.txt followed by the first lines of each file that differ from each other. This is text. No xyz abc The input loop should read and compare lines from each 123 хуz file, including whitespace and punctuation. The loop should break as soon as a pair of different lines is found. Comparing files that are the same: Below are examples of the program input and output along with relevant files:

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter14: Files And Streams
Section: Chapter Questions
Problem 2E: Create a program named FileComparison that compares two files. First, use a text editor such as...
icon
Related questions
Question

PYTHON CODING

Write a script named dif.py. This script should prompt the
This is text.
Comparing files that are different:
user for the names of two text files and compare the
abc
contents of the two files to see if they are the same.
123
1. If they are, the script should simply output "Yes".
Enter the first file name: one.txt
differentFromOne.txt
2. If they are not, the script should output "No",
Enter the second file name: differentFromOne.txt
followed by the first lines of each file that differ from
each other.
No
This is text.
abc
xyz
The input loop should read and compare lines from each
123
xyz
file, including whitespace and punctuation. The loop
should break as soon as a pair of different lines is found.
Comparing files that are the same:
Below are examples of the program input and output
along with relevant files:
Enter the first file name: one.txt
one.txt:
Enter the second file name: sameAsOne.txt
This is text.
Yes
abc
123
sameAsOne.txt:
dif.py
+
2 File: dif.py
3 Project 4.10
5 Deterines whether or not the contents of two text
6 files are the same. Outputs "Yes" if that is the
7 case or "No" and the first two lines that differ if
8 that is not the case.
9 II II||
10
11 # Put your code here
12
Transcribed Image Text:Write a script named dif.py. This script should prompt the This is text. Comparing files that are different: user for the names of two text files and compare the abc contents of the two files to see if they are the same. 123 1. If they are, the script should simply output "Yes". Enter the first file name: one.txt differentFromOne.txt 2. If they are not, the script should output "No", Enter the second file name: differentFromOne.txt followed by the first lines of each file that differ from each other. No This is text. abc xyz The input loop should read and compare lines from each 123 xyz file, including whitespace and punctuation. The loop should break as soon as a pair of different lines is found. Comparing files that are the same: Below are examples of the program input and output along with relevant files: Enter the first file name: one.txt one.txt: Enter the second file name: sameAsOne.txt This is text. Yes abc 123 sameAsOne.txt: dif.py + 2 File: dif.py 3 Project 4.10 5 Deterines whether or not the contents of two text 6 files are the same. Outputs "Yes" if that is the 7 case or "No" and the first two lines that differ if 8 that is not the case. 9 II II|| 10 11 # Put your code here 12
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Introduction to computer system
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
Computer Science
ISBN:
9781337569798
Author:
ECKERT
Publisher:
CENGAGE L
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage