1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Leokris [45]
3 years ago
5

Write a script named dif.py. This script should prompt the user for the names of two text files and compare the contents of the

two files to see if they are the same.
Computers and Technology
1 answer:
Andrej [43]3 years ago
8 0

Answer:

first = input("enter first file name: ")

second = input("enter second file name: ")

file_one = open(first, 'r')

file_two = open(second, 'r')

if file_one.read() == file_two.read():

   print("Both files are the same")

else:

   print("Different files")

file_one.close()

file_two.close()

Explanation:

The python module above is a procedural program. The first two lines ask for user inputs for both file names in string, then the files are opened and compared with the if-statement. At the end of the program, the files are closed to avoid leakage.

You might be interested in
Describe the difference between information poor and information rich society?​
Nadya [2.5K]

Answer:

The “Information poor” are consumers who use traditional mass media information such as television, DVDs, radios and magazines. ... On the opposite “information rich” stands for a new elite within the information society.

7 0
3 years ago
Read 2 more answers
I have this assignment due TONIGHT BEFORE 10PM! Please help. 50 points for whoever will help!! Here is the assignment.
saveliy_v [14]

Answer:

# include <iostream.h>

# include <conio.h>

using namespace std;

int generatelist ( int z[]);

int addlist(int x []; int y []);

int mullist(int x []; int y []);

int displayList(int z[]);

main()

{

int a[10] , b[10], add[10], mul[10];

cout<<"Enter value in array a";

generatelist(a[10]);

cout<<"Enter value in array b";

generatelist(b[10]);

for (int i=0; i<=9; i++)

{

add[i]=addlist( a[i], b[i]);

cout<<"sum of list = "<< add[i];

}

for (int i=0; i<=9; i++)

{

mul[i]=mullist( a[i], b[i]);

cout<<"multiplication of list = "<< mul[i];

}

for (int i=0; i<=9; i++)

{

displayList(a[i]);

}

for (int i=0; i<=9; i++)

{

displayList(b[i]);

}

for (int i=0; i<=9; i++)

{

displayList(add[i]);

}

for (int i=0; i<=9; i++)

{

displayList(mul[i]);

}

getch();

}

int generatelist ( int z[])

{

for (int j=0 ; j<=9 ; j++)

{

cin>>z[j];

return z[j]

}

}

int addlist(int x []; int y [])

{

int add

add=x+y;

return add;

}

int mullist(int x []; int y [])

{

int mul

mul=x*y;

return mul;

}

int displayList(int z[]);

{

for(int i=0; i<=9;i++)

cout << z[i]

}

7 0
4 years ago
You coded the following class: public class N extends String, Integer { }When you compile, you get the following message:N.java:
lidiya [134]

Answer:

Hi DancingGrace! The issue with the code is that it is trying to extend multiple classes which is not a feature in Java programming.

Explanation:

The extends keyword allows a class to use the attributes and properties of the base class it is extending and add more features and properties into it's own class. This is useful in programming where different models share similar properties but are slightly different. An example would be designing a class for Car and Bike. Both have some similar properties like wheels, engine, etc, however they are different forms of transport. A useful implementation would be to define a class called Vehicle with similar attributes, and have the Car and Bike extend it.  

7 0
4 years ago
ANSWER QUICKLY!!! <br><br> What is an advantage of digital portfolios?
algol13
Easy to carry or utilize
8 0
2 years ago
Make The PYTHON Code<br><br> print first 3 character of a string - given "Seattle" expected "Sea"
vlada-n [284]

This program uses a conditional to determine if seafood is safe to consume.

IF (seafood = "mollusk" OR daysFrozen ≥ 7) { rating ← "safe" } ELSE { rating ← "unsafe" }

In which situations will rating be "safe"?

️Note that there may be multiple answers to this question.

Choose all answers that apply:Choose all answers that apply:

1. When sea food is mollusk and day frozen is 1

2.When sea food is mollusk and day froze is 9

3. When see food salmon and day frozen is 7

<em>Did that help?</em>

6 0
2 years ago
Other questions:
  • Television broadcasts were originally delivered by using which technology
    14·1 answer
  • Considering the traffic problem, do you think Rod handled the situation well?
    15·1 answer
  • If you have created a document that contains a table that is 10 inches wide and 4 inches high, you will want to print the docume
    6·2 answers
  • Your program will search for prime numbers. You will first ask the user for the range of values to search, and use for loops to
    6·1 answer
  • Investigar las oportunidades de empleo y el autoempleo dentro del área de la especialidad<br>​
    14·1 answer
  • Why is it important to install updates? Why should you use the Power button on the Start menu instead of the Power button on you
    7·1 answer
  • Lonnie needs to use a special kind of block in his game that will tell him whether an object has slammed into his car true or no
    13·1 answer
  • Write a short essay about the best rotary-wing aircraft ever. It must be a specific aircraft and consist of three paragraphs. In
    9·1 answer
  • _____is used to organize and modify the properties of the current selection.
    6·1 answer
  • How to be gud at Friday night funk
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!