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
Reptile [31]
3 years ago
6

python Write a program that asks a user to type in two strings and that prints •the characters that occur in both strings. •the

characters that occur in one string but not the other. •the letters that don’t occur in either string. Use the set function to turn a string into a set of characters.
Engineering
1 answer:
Yuliya22 [10]3 years ago
8 0

Answer:

see explanation

Explanation:

#we first get the elements as inputs

x = input("enter string A :")

y = input("enter string B :")

#then we make independent sets with each

x = set(x)

y = set(y)

#then the intersection of the two sets

intersection = set.intersection(x,y)

#another set for the alphabet

#we use set.difference to get the elements present in x and not in y, and

#viceversa, finally we get the difference between the alphabet and the #intersection of the elements in our strings

z = set('abcdefghijklmnopqrstuvwxyz')

print('\nrepeated :\n',intersection)

print('differences :\n',' Items in A and not B\n',

set.difference(x,y),'\nItems in B and not A\n',

set.difference(y,x))

print('\nItems in neither :\n',set.difference(z,intersection))

You might be interested in
Takt time is the rate at which a factory must produce to satisfy the customer's demand. a)- True b)- False
laila [671]

Answer: a)True

Explanation: Takt time is defined as the average time difference between  the production of the two consecutive unit of goods by the manufacturer and this rate is matched with the demand of the customer. This is the time which is calculated to find the acceptable time for which the goods unit must be produced  by the factory to meet the needs of the customer. Therefore , the statement is true that takt time is the rate at which a factory must produce to satisfy the customer's demand.

6 0
3 years ago
Why might construction crews want to install pipes before the foundation is poured
Crazy boy [7]

The answer is choice C

Explanation:

As during construction ,the site is cleared for all debris before laying out the foundation. Even the sewer lines are dug out .

So it will be useful for the construction crews to  connect the pipes to the sewer lines before the foundation is poured.

But usually the steps take in construction activity is:- first the site is cleared for the foundation to be poured  and once the foundation wall is set , then all utilities , including plumbing and electrical activities are done.,

After this process is over, the city inspector comes to check whether the foundation has been laid down as per the code of construction.

Only after that the rest of the construction activity follows through.

3 0
3 years ago
By adding "-once", one can form the noun form of the word "organize" is that true or false?​
denpristay [2]

Answer:

<h2>False </h2>

Explanation:

The noun form of organize is just adding letter r

7 0
2 years ago
Read 2 more answers
Sam decides to remove his oversized hooded jacket before he works near the pto driveline is it safe or unsafe
Salsk061 [2.6K]
Its safe because it isn't something with electricity
4 0
2 years ago
My computer has a mass of 0.031080997078386 slug the Earth's surface.
poizon [28]

Answer:

The answer is "0.187 lbm and 1 lbf".

Explanation:

The mass = 0.031080997078386\  slug

Calculating mass on Mars:

\to m=m_g\frac{g}{g_e}

        =0.031080997078386 \times \frac{32.2}{5.35}\\\\=0.187 \ lbm

\to W=mg_e

        =0.187 \times 5.35\\\\=1 \ lbf

4 0
3 years ago
Other questions:
  • Air is compressed in a piston-cylinder device. List three examples of irreversibilities that could occur
    13·1 answer
  • Ammonia enters an adiabatic compressor operating at steady state as saturated vapor at 300 kPa and exits at 1400 kPa, 140◦C. Kin
    11·1 answer
  • For a rod of annealed AISI 1018 steel with a cross sectional area of 0.65 in^2?; what is the maximum tensile load Pmax that shou
    10·1 answer
  • I WILL GIVE BRAINLIEST IF ANSWER FAST What is the measurement of this dial caliper?
    5·2 answers
  • Which of the following is true of dead zones? a. They are formed when a volcanic eruption covers the soil with ash. b. They are
    15·1 answer
  • Wiring harnesses run
    12·1 answer
  • Define the Artist class in Artist.py with a constructor to initialize an artist's information. The constructor should by default
    7·1 answer
  • Which design activity is part of the design for manufacturability (DFM) methodology?
    10·1 answer
  • The most important rating for batteries is the what
    11·1 answer
  • An ideal gas is contained in a closed assembly with an initial pressure and temperature of
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!