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]
4 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]4 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
0/5 pts
Brilliant_brown [7]

Explanation:

150 divide by 150 and that how you do the is you what to divide together 15/ 150 you welcome have a good day is you need something else

4 0
3 years ago
Who was part of dempwolf his firm when he first started
Zinaida [17]

Explanation:

Dempwolf created by John Augustus, Among the most prominent innovative solutions in Southern California Pennsylvania was established by Dempwolf with  brother Reinhardt or uncle's son Frederick entered the company of J.A. Dozens of structures in 10 states were engineered by Dempwolf.

5 0
3 years ago
Here is to the people who need points (*again*) Have a good day!
alexdok [17]
Thank you so much!! You too!
8 0
3 years ago
Read 2 more answers
Air in a piston–cylinder assembly, initially at 3 bar, 142 K, and a volume of 2 m3. The air undergoes a process to a state where
Archy [21]

Answer:

mass of the air = 14.62kg

Workdone = 415.88 kJ

Heat transfer = 415.88 kJ

Explanation:

Please find the attached files for the solution

6 0
3 years ago
Read 2 more answers
. . . . . . . . . . ..........
Naddika [18.5K]

Answer: Thx for points...

Explanation:

Heres Random Info About Enginnering (because why not): Engineers are involved in all aspects of interactive TV technology, from designing new cables, to creating new film emulsions, to engineering better sound quality. This technology allows viewers to select any program, film, or game from more than 500 channels. Engineers play an instrumental role in the theme park industry?

Hope This Helps Someday!

5 0
3 years ago
Other questions:
  • Match the description with the term. I need help
    7·1 answer
  • The SDS for any chemical used at a job site must be available
    6·2 answers
  • What are the seven problem solving steps?
    12·1 answer
  • Consider tests of an unswept wing that spans the wind tunnel and whose airfoil section is NACA 23012. Since the wing model spans
    13·1 answer
  • To provide some perspective on the dimensions of atomic defects, consider a metal specimen that has a dislocation density of 105
    6·1 answer
  • An organization sets its standards for quality according to the best product it can produce.
    11·2 answers
  • Which statements describe the motion of car A and car B? Check all that apply. Car A and car B are both moving toward the origin
    7·1 answer
  • Why dose bob not let humans touch him one and only Ivan
    8·1 answer
  • Why do the quadrants in coordinate plane go anti-clockwise?.
    6·1 answer
  • A motor takes 38 amperes on a 220-volt circuit. Find the horsepower output (hp) of the motor shown with an efficiency of 90%. Ex
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!