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
A water-filled manometer is used to measure the pressure in an air-filled tank. One leg of the manometer is open to atmosphere.
ddd [48]

Answer:

P = 150.335\,kPa (Option B)

Explanation:

The absolute pressure of the air-filled tank is:

P = 101.3\,kPa + \left(1000\,\frac{kg}{m^{3}} \right)\cdot \left(9.807\,\frac{kg}{m^{3}} \right)\cdot (5\,m)\cdot \left(\frac{1\,kPa}{1000\,Pa} \right)

P = 150.335\,kPa

4 0
3 years ago
Primary Creep: slope (creep rate) decreases with time
Igoryamba

Answer:

true

Explanation:

Creep is known as the time dependent deformation of structure due to constant load acting on the body.

Creep is generally seen at high temperature.

Due to creep the length of the structure increases which is not fit for serviceability purpose.

When time passes structure gain strength as the structure strength increases with time so creep tends to decrease.

When we talk about Creep rate for new structure the creep will be more than the old structure i.e. the creep rate decreases with time.

5 0
3 years ago
A metal bar has a 0.6 in. x 0.6 in. cross section and a gauge length of 2 in. The bar is loaded with a tensile force of 50,000 l
Aleks [24]

Answer:

modulus =3.97X10^6 Ib/in^2, Poisson's ratio = 0.048

Explanation:

Modulus is the ratio of tensile stress to tensile strain

Poisson's ratio is the ratio of transverse contraction strain to longitudinal extension strain within the direction of the stretching force

And contraction occur from 0.6 in x 0.6 in to 0.599 in x 0.599 in while 2 in extended to 2.007, with extension of 0.007 in

5 0
3 years ago
For laminar flow over a hot flat plate, the local heat transfer coefficient decreases with distance because (select all that are
kotegsom [21]

Answer:

B. The thickness of the heated region near the plate is increasing.

Explanation:

First we know that, a boundary layer is the layer of fluid in the immediate vicinity of a bounding surface where the effects of viscosity are significant. The fluid is often slower due to the effects of viscosity. Advection i.e the transfer of heat by the flow of liquid becomes less since the flow is slower, thereby the local heat transfer coefficient decreases.

From law of conduction, we observe that heat transfer rate will decrease based on a smaller rate of temperature, the thickness therefore increases while the local heat transfer coefficient decreases with distance.

3 0
4 years ago
The two boxcars A and B have a weight of 20 000 Ib and 30 000 Ib, respectively. If they coast freely down the incline when the b
Tpy6a [65]

Answer:

Answer for the question :

"the two boxcars A and B have a weight of 20 000 Ib and 30 000 Ib, respectively. If they coast freely down the incline when the brakes are applied to all the wheels of car A causing it to skid, determine the force in the coupling C between the two cars. The coefficient of kinetic friction between the wheels of A and the tracks is μk=0.5. The wheels of car B are free to roll. Neglect their mass in calculation."

is explained in the attachment.

Explanation:

Download pdf
3 0
3 years ago
Read 2 more answers
Other questions:
  • Thermal energy generated by the electrical resistance of a 5-mm-diameter and 4-m-long bare cable is dissipated to the surroundin
    12·1 answer
  • A pressure cylinder has an outer diameter 200 mm, maximum external pressure 4 MPa, and maximum allowable shear stress 27.5 MPa.
    13·1 answer
  • The snowmobile has a weight of 250 lb, centered at G1, while the rider has a weight of 150 lb, centered at G2. Ifh=3ft, determin
    11·1 answer
  • A 200 W vacuum cleaner is powered by an electric motor whose efficiency is 70%. (Note that the electric motor delivers 200 W of
    13·1 answer
  • A common rule of thumb for controller discretization is to have "6 samples per rise time" in order to achieve a reasonable appro
    9·1 answer
  • Water evaporating from a pond does so as if it were diffusing across an air film 0.15 cm thick. The diffusion coefficient of wat
    8·1 answer
  • A power plant burns natural gas to supply heat to a heat engine which rejects heat to the adjacent river. The power plant produc
    11·1 answer
  • The guy wires AB and AC are attached to the top of the transmission tower. The tension in cable AB is 8.7 kN. Determine the requ
    8·1 answer
  • If a tapered roller bearing is adjusted to loose, the bearing will bind and overheat.
    11·1 answer
  • 8th grade safety test
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!