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
To assist in completing this question, you may reference the Animated Technique Video - MALDI-TOF Mass Spectroscopy. Complete th
a_sh-v [17]

Complete Question

The complete question is shown on the first uploaded image.

Answer:

The answer is shown on the second uploaded image

Explanation:

The explanation is also shown on the second uploaded image

3 0
3 years ago
A three-point bending test was performed on an aluminum oxide specimen having a circular cross section of radius 5.6 mm; the spe
ankoles [38]

Answer:

F =  8849 N

Explanation:

Given:

Load at a given point = F =  4250 N

Support span = L = 44 mm

Radius = R = 5.6 mm

length thickness of tested material = 12 mm

First compute the flexural strength for circular cross section using the formula below:

σ_{fs} = F_{f} L / \pi  R^{3}

σ = FL / π R³

Putting the given values in the above formula:

σ = 4250 ( 44 x 10⁻³ ) / π  ( 5.6 x 10⁻³ ) ³

  = 4250 ( 44 x 10⁻³ )  / 3.141593 ( 5.6 x 10⁻³ ) ³

  = 4250 (44 x 1 /1000 )) / 3.141593 ( 5.6 x 10⁻³ ) ³

  = 4250 ( 11 / 250  ) / 3.141593 ( 5.6 x 10⁻³ ) ³

  = 187 / 3.141593 ( 5.6 x 1 / 1000 ) ³

  = 187 / 3.141593 (0.0056)³

  = 338943767.745358

  = 338.943768 x 10⁶

σ = 338 x 10⁶ N/m²

Now we compute the load i.e. F from the following formula:

F_{f} = 2 σ_{fs} d³/3 L

F = 2σd³/3L

  = 2(338 x 10⁶)(12 x 10⁻³)³ / 3(44 x 10⁻³)

  = 2 ( 338 x 1000000 ) ( 12 x 10⁻³)³ / 3 ( 44 x 10⁻³)

  = 2 ( 338000000 ) ( 12 x 10⁻³)³ / 3 ( 44 x 10⁻³)

  = 676000000 ( 12 x 10⁻³)³ / 3 ( 44 x 10⁻³)

  = 676000000 ( 12  x  1/1000  )³ / 3 ( 44 x 10⁻³)

  = 676000000 (  3  / 250  )³ / 3 ( 44 x 10⁻³)

  = 676000000 (  27  / 15625000 )  / 3 ( 44 x 10⁻³)

  = 146016  / 125 / 3 ( 44 x 1 / 1000  )

  = ( 146016  / 125 ) /  (3 ( 11 /  250 ))

  =  97344  / 11

F =  8849 N

4 0
3 years ago
Foam weather stripping is often placed in the frames of doors and
Firdavs [7]

Answer:

prevents weathering

Explanation:

6 0
3 years ago
A monatomic ideal gas undergoes a quasi-static process that is described by the function p(????)=p1+3(????−????1) , where the st
Alenkasestr [34]

A pure gas made up only of atoms. The noble gases argon, krypton, and xenon are some examples.

Concepts:

Perfect gas law: Work performed on the system: PV = nRT W = -∫PdV

Energy preservation formula: U = Q + W

Reasoning:

W = nRT ln(Vi/Vf) when the process is isothermal.

The temperature is said to be constant, and we are given n, Pfinal, and Vfinal.

Calculation information:

(A) A process that is isothermal has a constant temperature.

PV = nRT, and hence, constant

nRT = PV = 101000 Pa*25*10-3 m3

For a process that is isothermal, W = nRT ln(Vi/Vf).

W/(nRT)=3000 J/(101000 Pa*25*10-3 m3)=-1.19

(The gas produces -W of labor.)

Vi = (25*10-3 m3)/3.28 = 7.62*10-3 m3 = 7.62 L where Vf/Vi = exp(1.19) = 3.28 Vi (b) for a perfect gas PV = nRT. 101000 Pa*25*10-3 m3 = (8.31 J/K) T. T = 303.85 K.

To know more about process click here:

brainly.com/question/29310303

#SPJ4

5 0
1 year ago
Why might construction crews want to install pipes before the foundation is poured?
denpristay [2]
I’m a concrete mason myself and I can tell you it is a pain in the butt to Roto hammer a hole into the concrete to put the pipe in it’s a lot easier to just pour the concrete around it
6 0
3 years ago
Other questions:
  • 6.Identification of Material ParametersThe principal in-plane stresses and associated strains in a plate of material areσ1= 50 k
    5·1 answer
  • g The pump inlet is located 1 m above an arbitrary datum. The pressure and velocity at the inlet are 100 kPa and 2 m/s, respecti
    8·1 answer
  • 1. Looking at the case study provided under the Companion Material section, what is the main problem that is addressed in this c
    13·1 answer
  • How do I cancel my subscription
    12·2 answers
  • Which best describes the body in terms of simple machines?
    6·1 answer
  • You are preparing to work with Chemical A. You open the appropriate storage cabinet, and notice Chemical B, as well as Chemical
    9·1 answer
  • What is a network? I'LL MARK BRAINLEST
    12·2 answers
  • At what distance from the Earth’s surface is a 10,000 kg satellite if its potential energy is equal to –5.58 x 1011 J? (choose t
    5·1 answer
  • 10) A pressure sensor consisting of a diaphragm with strain gauges bonded to its surface has the following information in its sp
    12·1 answer
  • You set a sensor to transmit the wind speed on top of a mountain. Which of these languages are you most likely to have used?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!