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]
3 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]3 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) The lower yield point for an iron that has an average grain diameter of 1 x 10-2 mm is 230 MPa. At a grain diameter of 6 x 1
olya-2409 [2.1K]

Answer:

The answer is "4.35 \times 10^{-3}\  mm and 157.5 MPa".

Explanation:

In point A:

The strength of its products with both the grain dimension is linked to this problem. This formula also for grain diameter of 310 MPA is represented as its low yield point  

y =  yo + \frac{k}{\sqrt{x}}

Here y is MPa is low yield point, x is mm grain size, and k becomes proportionality constant.  

Replacing the equation for each condition:  

y = y_o + \frac{k}{\sqrt{(1 \times 10^{-2})}}\\\\\ \ \ \ \ \ \ 230 = yo + 10k\\\\ y = yo + \frac{k}{\sqrt{(6\times 10^{-3})}}\\\\275 = yo + 12.90k

People can get yo = 275 MPa with both equations and k= 15.5 Mpa mm^{\frac{1}{2}}.

To substitute the answer,  

310 = 275 + \frac{(15.5)}{\sqrt{x}}\\\\x = 0.00435 \ mm = 4.35 \times 10^{-3}\  mm

In point b:

The equation is \sigma y = \sigma 0 + k y d^{\frac{1}{2}}

equation is:

75 = \sigma o+4 ky \\\\175 = \sigma o+12 ky\\\\ky = 12.5 MPa (mm)^{\frac{1}{2}} \\\\ \sigma 0 = 25 MPa\\\\d= 8.9 \times 10^{-3}\\\\d^{- \frac{1}{2}} =10.6 mm^{-\frac{1}{2}}\\

by putting the above value in the formula we get the \sigma y value that is= 157.5 MPa

5 0
3 years ago
The question “How do plants convert sunlight to energy?” best represents which of the following?
OverLord2011 [107]

Answer:

D

Explanation:

I would say this awnser because its the only one that makes sence to me

5 0
3 years ago
A city is experiencing a windstorm. The wind has blown away some of the houses in that city. What load bearing factor did the ar
yuradex [85]

Answer:

oa

Explanation:

6 0
2 years ago
Ai r is compressed by a 30-kW compressor from P1 to P2. The air t emperature i s maintained constant at 25oC during thi s proces
RUDIKE [14]

Answer:

The rate of entropy change of the air is -0.10067kW/K

Explanation:

We'll assume the following

1. It is a steady-flow process;

2. The changes in the kinetic energy and the potential energy are negligible;

3. Lastly, the air is an ideal gas

Energy balance will be required to calculate heat loss;

mh1 + W = mh2 + Q where W = Q.

Also note that the rate of entropy change of the air is calculated by calculating the rate of heat transfer and temperature of the air, as follows;

Rate of Entropy Change = -Q/T

Where Q = 30Kw

T = Temperature of air = 25°C = 298K

Rate = -30/298

Rate = -0.100671140939597 KW/K

Rate = -0.10067kW/K

Hence, the rate of entropy change of the air is -0.10067kW/K

3 0
3 years ago
What types of problems might an electrical engineer need to solve?
aleksandr82 [10.1K]

Answer:

sectores industriales, comerciales o públicos, o para el uso doméstico.

Explanation:

8 0
3 years ago
Other questions:
  • Explain the difference between thermoplastics and thermosets giving structure property correlation.
    5·1 answer
  • you are planning to buy a new couch for your family room you measure the available space and conclude that the couch should be b
    5·1 answer
  • The Hoover Dam is 221 m tall and 379 m wide. Approximating it as a flat plate, determine the effective resultant force on the da
    6·1 answer
  • 1. A 260 ft (79.25 m) length of size 4 AWG uncoated copper wire operating at a tem-
    8·1 answer
  • Who is???????????????????
    13·1 answer
  • Refrigerant-134a enters the expansion valve of a refrigeration system at 120 psia as a saturated liquid and leaves at 20 psia. D
    15·1 answer
  • Can someone tell me what car, year, and model this is please
    15·2 answers
  • Characteristics of 3 types of soil​
    10·1 answer
  • How does energy transition from one form to another as water moves from behind a dam to downstream of a dam?.
    8·1 answer
  • QUICK ASAP
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!