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
This search compares the target value with the middle element in the collection, then ignores the half of the collection in whic
love history [14]

Answer:

d) Binary

Explanation:

Binary search is a search algorithm that finds the position of a value in an ordered array. It compares the value with the element in the middle of the array, if they are not equal, half in which the value cannot be eliminated and the search continues in the remaining half until the value is found.

7 0
3 years ago
53. The plan of a building is in the form of a rectangle with
schepotkina [342]

Answer: 150m

Explanation:

The following can be depicted from the question:

Dimensions of outer walls = 9.7m × 14.7m.

Thickness of the wall = 0.30 m

Therefore, the plinth area of the building will be:

= (9.7 + 0.30/2 + 0.30/2) × (14.7 × 0.30/2 + 0.30/2)

= 10 × 15

= 150m

7 0
3 years ago
ANSWER FAST PLEASE!!! WILL MARK BRAINLIEST!!!!!!
Phoenix [80]

Answer:

Phuong works on a research project and creates a report for her boss.

5 0
3 years ago
Read 2 more answers
The status of which of these determines the sequence in which output devices, such as solenoid values and motor contactors, are
Mkey [24]
A. Physical I/O sensors

Safety switches, operator inputs, travel limit switches etc
5 0
3 years ago
What are the relevance of report writing
nasty-shy [4]

Answer:Report writing consists of the history and facts of a project or of any kind of event. It is useful to record past history and an overall summary of decisions. Report writing helps to solve problems as a path. Writing a report will guide you in a way that will modernize details of the improvements and upcoming plans.

6 0
2 years ago
Other questions:
  • Which statement about direct-mail messages is most accurate? Group of answer choices Direct mail is an effective channel for per
    15·1 answer
  • A freshly annealed glass containing flaws of maximum length of 0.1 microns breaks under a tensile stress of 120 MPa. If a sample
    13·1 answer
  • A steam reformer operating at 650C and 1 atm uses propane as fuel for hydrogen production. At the given operating conditions, th
    12·1 answer
  • What is the magnitude of the maximum stress that exists at the tip of an internal crack having a radius of curvature of 2.5×10-4
    13·1 answer
  • The water behind Hoover Dam is 206m higher than the Colorado river below it. At what rate must water pass through the hydraulic
    15·2 answers
  • A 4-pole, 3-phase induction motor operates from a supply whose frequency is 60 Hz. calculate: 1- the speed at which the magnetic
    10·1 answer
  • A tailgate may have a latch on both sides.<br> O True<br> O False
    10·2 answers
  • Can you guys please introduce yourself​
    15·2 answers
  • Glyphicons is mainly used for​
    12·1 answer
  • What should you use to keep battery terminals from corroding
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!