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
15 POINTS! Help.
IRISSAK [1]

Answer: it would  overload

Explanation:

4 0
2 years ago
Read 2 more answers
Advantages of using metal
Contact [7]

Answer:

Metals have high melting points thus unlikely to degrade when temperatures increase, they can be fabricated and are cost effective due to availability.

Explanation:

Aluminum is the most abundant in the Earth's crust with good thermal and electric properties. It is soft, malleable ,ductile and lighter making it a vital metal in construction industry. An alloy of copper and tin, bronze is a better connector of heat and electricity ,commonly used in automobile industry for bearings and springs production. Steel a carbon alloy has applications in forging and automotive.

4 0
2 years ago
Air enters a cmpressor at 20 deg C and 80 kPa and exits at 800 kPa and 200 deg C. The power input is 400 kW. Find the heat trans
aksik [14]

Answer:

The heat is transferred is at the rate of 752.33 kW

Solution:

As per the question:

Temperature at inlet, T_{i} = 20^{\circ}C = 273 + 20 = 293 K

Temperature at the outlet, T_{o} = 200{\circ}C = 273 + 200 = 473 K

Pressure at inlet, P_{i} = 80 kPa = 80\times 10^{3} Pa

Pressure at outlet, P_{o} = 800 kPa = 800\times 10^{3} Pa

Speed at the outlet, v_{o} = 20 m/s

Diameter of the tube, D = 10 cm = 10\times 10^{- 2} m = 0.1 m

Input power, P_{i} = 400 kW = 400\times 10^{3} W

Now,

To calculate the heat transfer, Q, we make use of the steady flow eqn:

h_{i} + \frac{v_{i}^{2}}{2} + gH  + Q = h_{o} + \frac{v_{o}^{2}}{2} + gH' + p_{s}

where

h_{i} = specific enthalpy at inlet

h_{o} = specific enthalpy at outlet

v_{i} = air speed at inlet

p_{s} = specific power input

H and H' = Elevation of inlet and outlet

Now, if

v_{i} = 0 and H = H'

Then the above eqn reduces to:

h_{i} + gH + Q = h_{o} + \frac{v_{o}^{2}}{2} + gH + p_{s}

Q = h_{o} - h_{i} + \frac{v_{o}^{2}}{2} + p_{s}                (1)

Also,

p_{s} = \frac{P_{i}}{ mass, m}

Area of cross-section, A = \frac{\pi D^{2}}{4} =\frac{\pi 0.1^{2}}{4} = 7.85\times 10^{- 3} m^{2}

Specific Volume at outlet, V_{o} = A\times v_{o} = 7.85\times 10^{- 3}\times 20 = 0.157 m^{3}/s

From the eqn:

P_{o}V_{o} = mRT_{o}

m = \frac{800\times 10^{3}\times 0.157}{287\times 473} = 0.925 kg/s

Now,

p_{s} = \frac{400\times 10^{3}}{0.925} = 432.432 kJ/kg

Also,

\Delta h = h_{o} - h_{i} = c_{p}\Delta T =c_{p}(T_{o} - T_{i}) = 1.005(200 - 20) = 180.9 kJ/kg

Now, using these values in eqn (1):

Q = 180.9 + \frac{20^{2}}{2} + 432.432 = 813.33 kW

Now, rate of heat transfer, q:

q = mQ = 0.925\times 813.33 = 752.33 kW

4 0
2 years ago
The ???? − i relationship for an electromagnetic system is given by ???? = 1.2i1/2 g where g is the air-gap length. For current
Artemon [7]

Answer:

a) The mechanical force is -226.2 N

b) Using the coenergy the mechanical force is -226.2 N

Explanation:

a) Energy of the system:

\lambda =\frac{1.2*i^{1/2} }{g} \\i=(\frac{\lambda g}{1.2} )^{2}

\frac{\delta w_{f} }{\delta g} =\frac{g^{2}\lambda ^{3}  }{3*1.2^{2} }

f_{m}=- \frac{\delta w_{f} }{\delta g} =-\frac{g^{2}\lambda ^{3}  }{3*1.2^{2} }

If i = 2A and g = 10 cm

\lambda =\frac{1.2*i^{1/2} }{g} =\frac{1.2*2^{1/2} }{10x10^{-2} } =16.97

f_{m}=-\frac{g^{2}\lambda ^{3}  }{3*1.2^{2} }=-\frac{16.97^{3}*2*0.1 }{3*1.2^{2} } =-226.2N

b) Using the coenergy of the system:

f_{m}=- \frac{\delta w_{f} }{\delta g} =-\frac{1.2*2*i^{3/2}  }{3*g^{2} }=-\frac{1.2*2*2^{3/2} }{3*0.1^{2} } =-226.2N

8 0
2 years ago
A horizontal pipe has an abrupt expansion from D1 5 8 cm to D2 5 16 cm. The water velocity in the smaller section is 10 m/s and
anyanavicka [17]
  • Answer:  Explanation:  Application of the bernoulli's equation comes in from conservation of mass flow.  The cross sectional area of the two pipes are calculated. from A = πD²/4 The velocity of water from conservation of mass flow is also calculated ; V2 = Ac1V1/Ac2 The Loss coefficient is then calculated from KL = (1 - Ac1²/Ac2²)² Then the head Loss (hL) is calculated  The detailed calculated and appropriate steps is as shown in the attached files.

5 0
2 years ago
Other questions:
  • As you discovered in lab last week, the advantage of CMOS logic is that no drain current flows through the MOSFETs when the outp
    14·1 answer
  • Is it more difficult to pump oil from a well on dry land or a well under water?Why?
    11·1 answer
  • A Water Amusement Park parking lot charges $24.00 minimum fee to park for up to 8 hours. The meter charges an additional $3.25 p
    5·2 answers
  • IN JAVA,
    6·1 answer
  • Air is to be heated steadily by an 8-kW electric resistance heater as it flows through an insulated duct. If the air enters at 5
    10·1 answer
  • The basic concept of feedback control is that an error must exist before some corrective action can be made?
    12·1 answer
  • The price of a single item within a group of items is
    8·1 answer
  • Heating of Oil by Air. A flow of 2200 lbm/h of hydrocarbon oil at 100°F enters a heat exchanger, where it is heated to 150°F by
    7·1 answer
  • Why won't Brainly let me make a account or log in? It's always telling me that it can't take my registration at this time or it
    9·1 answer
  • Please help i will give brainilest
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!