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
Zanzabum
3 years ago
5

The y and z keys swapping position is messing with your touch typing. You decide to write out your email as if the keys were in

the correct position and then use Python to swap all ys and zs. Your task here is to write a function called fix_yz. This function takes a single argument which will be a string. Your function needs to return this string with all of the ys and zs swapped, and all of the Ys and Zs swapped. Here are some example calls to your function:
s = fix_yz('What did zou saz?')print(s)What did you say?s = fix_yz('Zour tip about the yoo was a great one!')print(s)Your tip about the zoo was a great one!s = fix_yz('We onlz have one week left')print(s)We only have one week left :(HintThe auto-marker is expecting you to submit only your fix_yz function definition. You should not include any calls to your function.

Engineering
1 answer:
Zarrin [17]3 years ago
4 0

Answer:

# the function fix_yz is defined

# it takes a string as parameter

def fix_yz(word):

   # new_word is to hold the new corrected string

   new_word = ""

   # loop through the string

   # and check for any instance of y or z.

   # if any instance is found, it is replaced accordingly

   for each_letter in word:

       if each_letter == 'z':

           new_word += 'y'

       elif each_letter == 'Z':

           new_word += 'Y'    

       elif each_letter == 'y':

           new_word += 'z'

       elif each_letter == 'Y':

           new_word += 'Z'        

       else:

           new_word += each_letter

   # the value of new string is returned

   return new_word        

Explanation:

The function is written in Python 3 and it is well commented. An image is attached showing the output of the given example.

The function take a string as input. It then loop through the string and check for any instance of 'y' or 'z'; if any instance is found it is swapped accordingly and then append to the new_word.

The value of bew_word is returned after the loop.

You might be interested in
A displacement transducer has the following specifications: Linearity error ± 0.25% reading Drift ± 0.05%/○C reading Sensitivity
White raven [17]

Answer:

The Estimated uncertainty in a nominal displacement of 2 cm at the design stage is plus or minus 0.0124cm

Explanation:

uncertainty in a nominal displacement

= (u^2 + v^2)^(1/2)

assume from specifications that k = 5v/5cm

                                                         = 1v/cm

u^2 = (0.0025*2)^(2) + (0.005*10*2)^2 + (0.0025*2)^2

      = 0.01225v

v = 2v * 0.001

  = 0.002v

uncertainty in a nominal displacement

= (u^2 + v^2)^(1/2)

= ((0.01225)^2 + (0.002)^2)^(1/2)

= 0.0124 cm

Therefore, The Estimated uncertainty in a nominal displacement of 2 cm at the design stage is plus or minus 0.0124cm

8 0
3 years ago
Draw a 3-D physical structure of an NMOS transistor. Label four terminals: body, drain, gate, and source. And also label silicon
Vanyuwa [196]

Answer:

Answer is attached.

Explanation:

A NMOS is a n-channel MOSFET or Metal Oxide

Semiconductor Field Effect Transistor. This type

of transistor might be an enhancement or

depletion type nMOS transistor designed using

layers of Metal-oxide, Silicon-oxide and Silicon

fabricated on a substrate.

4 0
3 years ago
FRIDAY<br> What does a lockbar do?
IrinaK [193]

Answer:

it increases the life of a frame lock

Explanation:

because it decreases wear on the lock face

6 0
2 years ago
Read 2 more answers
Which of the following is not a reason to give yourself extra "cushion" when driving?
damaskus [11]

Answer:

The question is incomplete, the complete question is:

Which of the following is not a reason to give yourself extra "cushion" when driving?

A. Poor visibility B. Poor road conditions C. Inclement weather D. None of these.

The correct answer is D. None of these.

Explanation:

All the options are not reasons to give yourself an extra cushion when driving, rather they are reasons that are not favorable to driving at all.

A cushion is a certain amount of distance you are supposed to keep between you and the car in front of you to allow easy maneuvering in any condition.

A typical cushion is 3 seconds between you and the car in front of you, in less than perfect conditions like bad weather or poor road conditions an additional second must be added to it.

7 0
3 years ago
Determine the slopes and deflections at points B and C for the beam shown below by the moment-area method. E=constant=70Gpa I=50
inn [45]

Answer:

hello your question is incomplete attached below is the complete question

answer :

Slopes : B = 180 mm , C = 373 mm

Deflection: B = 0.0514 rad ,  C = 0.077 rad

Explanation:

Given data :

I = 500(10^6) mm^4

E = 70 GPa

The M / EI  diagram is attached below

<u><em>Deflection angle at B</em></u>

∅B = ∅BA = [ 150 (6) + 1/2 (300)*6 ] / EI

                 = 1800 / ( 500 * 70 ) = 0.0514 rad

<u><em>slope at B </em></u>

ΔB = ΔBA = [ 150(6)*3 + 1/2 (300)*6*4 ] / EI

                 = 6300 / ( 500 * 70 ) = 0.18 m = 180 mm

<u><em>Deflection angle at C </em></u>

∅C = ∅CA = [ 1800 + 300*3 ] / EI

                 = 2700 / ( 500 * 70 )

                 = 2700 / 35000 = 0.077 rad

<u><em>Slope at C </em></u>

ΔC = [ 150 * 6 * 6 + 1/2 (800)*6*7 + 300(3) *1.5 ]

     = 13050 / 35000 = 373 mm

3 0
3 years ago
Other questions:
  • Pine Valley Furniture wants to use Internet systems to provide value to its customers and staff. There are many software technol
    5·1 answer
  • What two elements make up fuel oil​
    9·1 answer
  • Is it true or false that sometimes people except certain risks in exchange for other benefits
    13·1 answer
  • Which option distinguishes what can be inferred from the following scenario?
    14·1 answer
  • Suppose that the following eight jobs must be scheduled through a car repair facility (repair times are shown in days): Car Repa
    13·1 answer
  • Select the correct answer.
    6·1 answer
  • When trying to bleed a vehicle with heigh sensing proportioning valve, the technician notices there is no pressure/fluid coming
    7·1 answer
  • In one study the critical stress intensity factor for human bone was calculated to be 4.05 MN/m3/2. If the value of Y in Eq. (2.
    6·1 answer
  • n order to test whether camshafts are being manufactured to specification a sample of n = 35 camshafts are selected at random. T
    11·1 answer
  • I’ll give you 100 points
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!