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:
Answer:
1) The exergy of destruction is approximately 456.93 kW
2) The reversible power output is approximately 5456.93 kW
Explanation:
1) The given parameters are;
P₁ = 8 MPa
T₁ = 500°C
From which we have;
s₁ = 6.727 kJ/(kg·K)
h₁ = 3399 kJ/kg
P₂ = 2 MPa
T₂ = 350°C
From which we have;
s₂ = 6.958 kJ/(kg·K)
h₂ = 3138 kJ/kg
P₃ = 2 MPa
T₃ = 500°C
From which we have;
s₃ = 7.434 kJ/(kg·K)
h₃ = 3468 kJ/kg
P₄ = 30 KPa
T₄ = 69.09 C (saturation temperature)
From which we have;
h₄ =
+ x₄×
= 289.229 + 0.97*2335.32 = 2554.49 kJ/kg
s₄ =
+ x₄×
= 0.94394 + 0.97*6.8235 ≈ 7.563 kJ/(kg·K)
The exergy of destruction,
, is given as follows;
= T₀ ×
= T₀ ×
× (s₄ + s₂ - s₁ - s₃)
= T₀ ×
×(s₄ + s₂ - s₁ - s₃)/(h₁ + h₃ - h₂ - h₄)
∴
= 298.15 × 5000 × (7.563 + 6.958 - 6.727 - 7.434)/(3399 + 3468 - 3138 - 2554.49) ≈ 456.93 kW
The exergy of destruction ≈ 456.93 kW
2) The reversible power output,
=
+
≈ 5000 + 456.93 kW = 5456.93 kW
The reversible power output ≈ 5456.93 kW.
Answer:
The red one
Explanation:
not acturlly a thing between them so i might be wrong