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
What are the 5 major forest types?
Nataly [62]

Answer:

1. Equatorial Evergreen or Rainforest

2. Tropical forest

3. Mediterranean forest

4. Temperate broad-leaved forest

5. Warm temperate forest

Explanation:

4 0
3 years ago
Read 2 more answers
You are designing the access control policies for a Web-based retail store. Customers access the store via the Web, browse produ
PolarNik [594]

Answer:

Object-Oriented Software Engineering Using UML, Patterns, and Java, 3e, shows readers how to use both the principles of software engineering and the practices of various object-oriented tools, processes, and products.

3 0
2 years ago
The best way to identify common masonry problems is to call the engineer.<br> True or False
Daniel [21]

Answer:

True

Explanation:

5 0
3 years ago
In RSA Digital Signature, Suppose Bob wants to send a signed message (x = 4) to Alice. The first steps are exactly t eps are exa
Luda [366]

Answer:

what r u on

Explanation:

4 0
3 years ago
How do you make a robotic dog
fredd [130]
In order to create a robotic dog, you are needing the necessary parts to create Goddard from Jimmy nutreon boy genius
7 0
3 years ago
Read 2 more answers
Other questions:
  • What is the capacity of the machine in batches?
    10·1 answer
  • A DOHC V-6 has how many camshafts?
    6·1 answer
  • An intranet is a restricted network that relies on Internet technologies to provide an Internet-like environment within the comp
    11·1 answer
  • 7. A single-pole GFCI breaker is rated at
    9·1 answer
  • 2 definiciones de personas en Técnicos en ingeniería eléctrica y agregar link.<br> Por favor❗❗❗
    13·1 answer
  • What is aviation? What is the difference between aviation and flight?
    9·1 answer
  • Technician A says when you push the horn button, electromagnetism moves an iron bar inside the horn, which opens and closes cont
    5·2 answers
  • 10.16.1: LAB: Interstate highway numbers (Python)
    9·1 answer
  • List five pieces of personal safety equipment which must be in everyday use in the workshop​
    15·1 answer
  • Time left 0:35:32 Three steel rod (E = 200 GPa) supports 36 KN Load P. Each of the rods AB and CD has a 200 mm? cross- sectional
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!