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
rodikova [14]
4 years ago
15

Write the following decorators and apply them to a single function (applying multiple decorators to a single function): 1. The f

irst decorator is called strong and has an inner function called wrapper. The purpose of this decorator is to add the html tags of and to the argument of the decorator. The return value of the wrapper should look like: return """" + func() + """" 2. The decorator will return the wrapper per usual. 3. The second decorat
Engineering
1 answer:
natita [175]4 years ago
5 0

Answer:

Complete question is:

write the following decorators and apply them to a single function (applying multiple decorators to a single function):

1. The first decorator is called strong and has an inner function called wrapper. The purpose of this decorator is to add the html tags of <strong> and </strong> to the argument of the decorator. The return value of the wrapper should look like: return “<strong>” + func() + “</strong>”

2. The decorator will return the wrapper per usual.

3. The second decorator is called emphasis and has an inner function called wrapper. The purpose of this decorator is to add the html tags of <em> and </em> to the argument of the decorator similar to step 1. The return value of the wrapper should look like: return “<em>” + func() + “</em>.

4. Use the greetings() function in problem 1 as the decorated function that simply prints “Hello”.

5. Apply both decorators (by @ operator to greetings()).

6. Invoke the greetings() function and capture the result.

Code :

def strong_decorator(func):

def func_wrapper(name):

return "<strong>{0}</strong>".format(func(name))

return func_wrapper

def em_decorator(func):

def func_wrapper(name):

return "<em>{0}</em>".format(func(name))

return func_wrapper

@strong_decorator

@em_decorator

def Greetings(name):

return "{0}".format(name)

print(Greetings("Hello"))

Explanation:

You might be interested in
A cylindrical specimen of brass that has a diameter of 20 mm, a tensile modulus of 110 GPa, and a Poisson’s ratio of 0.35 is pul
stealth61 [152]

Answer:

0.00116

Explanation

The tensile modulus is the measure of the elastic deformation that a material has undergo.

While elastic strain  is define as form of strain in which a body return to its original length after the removal of the force .

Strain s expressed as

e=\frac{F}{AE}

Where e is the strain, A is the area, F is the applied force and E itensile modulus

From the data given,

Force, F=40,000

Area=πr^2

and the tensile modulus E=110GPa

If we insert values we arrive at

e=\frac{F}{(\pi d^{2}/2)E}\\e=\frac{40,000}{\pi (20*10^{-3}/2)^{2} *110*10^{9}} \\e=0.00116

Hence the strain experienced by the material is 0.00116

7 0
3 years ago
Read 2 more answers
Nicholas wants to verify whether a file is a hard link to a file within the same directory. Which of the following commands coul
garri49 [273]

Answer:

d

Explanation:

Is is used to display files in a directory.  Is-l is used to see total information about a file including how many hardlink files are there in the directory.

5 0
4 years ago
All MOS devices are subject to damage from:________
Alchen [17]

Answer:

  d. all of these

Explanation:

Electrostatic discharge will generally produce excess voltage in a local area that results in excessive current and excessive heat. It will blast a crater in an MOS device, or melt bond wires, or cause damage of other sorts. In short, MOS devices are subject to damage from "all of these."

6 0
3 years ago
The pump of a water distribution system is powered by a 6-kW electric motor whose efficiency is 95 percent. The water flow rate
Sonja [21]

Answer:

a) Mechanical efficiency (\varepsilon)=63.15%  b) Temperature rise= 0.028ºC

Explanation:

For the item a) you have to define the mechanical power introduced (Wmec) to the system and the power transferred to the water (Pw).

The power input (electric motor) is equal to the motor power multiplied by the efficiency. Thus, Wmec=0.95*6kW=5.7 kW.

Then, the power transferred (Pw) to the fluid is equal to the flow rate (Q) multiplied by the pressure jump \Delta P. So P_W = Q*\Delta P=0.018m^3/s * 200x10^3 Pa=3600W.

The efficiency is defined as the ratio between the output energy and the input energy. Then, the mechanical efficiency is \varepsilon=3.6kW/5.7kW=0.6315=63.15\%

For the b) item you have to consider that the inefficiency goes to the fluid as heat. So it is necessary to use the equation of the heat capacity but in a "flux" way. Calling <em>H</em> to the heat transfered to the fluid, the specif heat of the water and \rho the density of the water:

[tex]H=(5.7-3.6) kW=\rho*Q*c*\Delta T=1000kg/m^3*0.018m^3/s*4186J/(kg \ºC)*\Delta T[/tex]

Finally, the temperature rise is:

\Delta T=2100/75348 \ºC=0.028 \ºC

7 0
3 years ago
Stakeholders are people or organizations who do what?
Soloha48 [4]

Answer:

B. fund the project

D. are partners with a vested interest

Explanation:

If you look at the definition of the word stakeholder, these options match the definition which is why I chose B and D

4 0
3 years ago
Read 2 more answers
Other questions:
  • Water at 20 °C is flowing with velocity of 0.5 m/s between two parallel flat plates placed 1 cm apart. Determine the distances f
    5·1 answer
  • technician A says that in any circuit, electrical current takes the path of least resistance. technician B says that while this
    13·1 answer
  • Indicate whether the following statements are true or false for a reversible process: (A) Q=0. (B) Work may be calculated using
    14·1 answer
  • A diameter shaft contains a deep U-shaped groove that has a radius at the bottom of the groove. The maximum shear stress in the
    6·1 answer
  • Compare and contrast arch and beam bridges
    13·1 answer
  • For a LED diode that has a= 632 nm, then the A1 is equal to:​
    13·1 answer
  • A schizophrenic disorder is characterized mostly by disturbed __________, while a mood disorder is characterized mostly by distu
    6·2 answers
  • What does 3CuCI2 mean
    11·1 answer
  • Calculate the magnitude of the resultant force F⃗ r=F⃗ 1+F⃗ 2+F⃗ 3 acting on the block.
    5·1 answer
  • How does science and technology address the problems of the society?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!