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
simply supported beam is subjected to a linearly varying distributed load ( ) 0 q x x L 5 q with maximum intensity 0 q at B. The
Pavlova-9 [17]

Answer:

q₀ = 350,740.2885 N/m

Explanation:

Given

q(x)=\frac{x}{L} q_{0}

σ = 120 MPa = 120*10⁶ Pa

L=4 m\\w=200 mm=0.2m\\h=300 mm=0.3m\\q_{0}=? \\

We can see the pic shown in order to understand the question.

We apply

∑MB = 0  (Counterclockwise is the positive rotation direction)

⇒ - Av*L + (q₀*L/2)*(L/3) = 0

⇒ Av = q₀*L/6   (↑)

Then, we apply

v(x)=\int\limits^L_0 {q(x)} \, dx\\v(x)=-\frac{q_{0}}{2L} x^{2}+\frac{q_{0} L}{6} \\M(x)=\int\limits^L_0 {v(x)} \, dx=-\frac{q_{0}}{6L} x^{3}+\frac{q_{0} L}{6}x

Then, we can get the maximum bending moment as follows

M'(x)=0\\ (-\frac{q_{0}}{6L} x^{3}+\frac{q_{0} L}{6}x)'=0\\ -\frac{q_{0}}{2L} x^{2}+\frac{q_{0} L}{6}=0\\x^{2} =\frac{L^{2}}{3}\\  x=\sqrt{\frac{L^{2}}{3}} =\frac{L}{\sqrt{3} }=\frac{4}{\sqrt{3} }m

then we get  

M(\frac{4}{\sqrt{3} })=-\frac{q_{0}}{6*4} (\frac{4}{\sqrt{3} })^{3}+\frac{q_{0} *4}{6}(\frac{4}{\sqrt{3} })\\ M(\frac{4}{\sqrt{3} })=-\frac{8}{9\sqrt{3} } q_{0} +\frac{8}{3\sqrt{3} } q_{0}=\frac{16}{9\sqrt{3} } q_{0}m^{2}

We get the inertia as follows

I=\frac{w*h^{3} }{12} \\ I=\frac{0.2m*(0.3m)^{3} }{12}=4.5*10^{-4}m^{4}

We use the formula

σ = M*y/I

⇒ M = σ*I/y

where

y=\frac{h}{2} =\frac{0.3m}{2}=0.15m

If M = Mmax, we have

(\frac{16}{9\sqrt{3} }m^{2} ) q_{0}\leq \frac{120*10^{6}Pa*4.5*10^{-4}m^{4}   }{0.15m}\\ q_{0}\leq 350,740.2885\frac{N}{m}

8 0
3 years ago
Which of the following is likely to have the suffix "" after the domain name in its URL?
vovangra [49]

Answer:

Microsoft is the correct answer

5 0
3 years ago
Read 2 more answers
The elastic settlement of an isolated single pile under a working load similar to that of piles in the group it represents, is p
Ganezh [65]

Answer:

The expected settlement for the pile group using the given information is 19.92mm or 0.79 inch

Explanation:

In this question, we are asked to calculate the expected settlement for the pole group given some information.

Please check attachment for complete solution and step by step explanation

3 0
3 years ago
A cylindrical specimen of a metal alloy 45.8 mm long and 9.72 mm in diameter is stressed in tension. A true stress of 378 MPa ca
Sliva [168]

Answer:

390.242 MPa

Explanation:

Attached is the full solution.

8 0
2 years ago
The lift on a spinning circular cylinder in a freestream with a velocity of 30 m/s and at standard sea level conditions is 6 N/m
Evgesh-ka [11]

Answer:

The circulation around the cylinder is 0.163 \frac{m^{2} }{s}

Explanation:

Given :

Velocity of spinning cylinder v = 30 \frac{m}{s}

Sea level density \rho = 1.23 \frac{kg}{m^{3} }

Sea level span L = 6 \frac{N}{m}

Lift per unit circulation is given by,

  L = \rho v c

Where c = circulation around cylinder

   c = \frac{L}{\rho v}

   c = \frac{6}{1.23 \times 30}

   c = 0.163 \frac{m^{2} }{s}

Therefore, the circulation around the cylinder is 0.163 \frac{m^{2} }{s}

5 0
3 years ago
Other questions:
  • A food-services company with a 480 V, three-phase service entrance has the following set of loads:  A 7 ton walk-in refrigerati
    13·1 answer
  • OSHA does not approve individual states to have their own safety and health program.
    15·2 answers
  • The Review_c object has a lookup relationship up to the Job_Application_c object. The job_Application_c object has a master-deta
    7·1 answer
  • A common rule of thumb for controller discretization is to have "6 samples per rise time" in order to achieve a reasonable appro
    9·1 answer
  • Explain the use of remote sensing in surveying.​
    8·1 answer
  • So far in your lifetime, about how much garbage have you contributed
    12·1 answer
  • On a given day, a barometer at the base of the Washington Monument reads 29.97 in. of mercury. What would the barometer reading
    6·1 answer
  • Express the unsteady angular momentum equation in vector form for a control volume that has a constant moment of inertia I, no e
    9·1 answer
  • What is the ideal cooling system for low horsepower motor? For example1hp motor
    9·1 answer
  • Which of the following parts tells the transmission how fast or slowly a vehicle is going? A) pump
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!