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
Initialize the tuple team_names with the strings 'Rockets', 'Raptors', 'Warriors', and 'Celtics' (The top-4 2018 NBA teams at th
Drupady [299]

Answer:

#Initialise a tuple

team_names = ('Rockets','Raptors','Warriors','Celtics')

print(team_names[0])

print(team_names[1])

print(team_names[2])

print(team_names[3])

Explanation:

The Python code illustrates or printed out the tuple team names at the end of a season.

The code displayed is a function that will display these teams as an output from the program.

4 0
3 years ago
HOW TO CALCULATE MARGINAL RATE
Basile [38]

Answer:

Divide the difference in tax by the amount of income from the investment, and you'll get the economic marginal tax rate from investing. Most people refer to marginal tax rates as being identical to tax brackets.

hope this helps

have a good day :)

Explanation:

8 0
3 years ago
The domain of discourse is the members of a chess club. The predicate B(x, y) means that person x has beaten person y at some po
satela [25.4K]

Answer:A. No one has ever beat Nancy.

Explanation:

The dormain of discourse in a simple language is the set of entities upon which our discussions are based when discussing about something.

The dormain of discourse is also known simply as universe, can also be said to be a set of entities o

upon which certain variables of interest in some formal treatment may range.

The dormain of discourse is generally attributed to Augustus De Morgan, it was also extensively used by George Boole in his Laws of Thought.

THE LOGICAL UNDERSTANDING OF THE THE QUESTION IS THAT NO ONE HAS EVER BEAT NANCY.

8 0
3 years ago
Write a system of equations to describe the situation below, solve using any method, and fill in the blanks.
Ann [662]

The number of tubs that each of them sold is; 24 tubs each

The number of days it will take for both of them to sell same amount of tubs is; 4 days

Number of cookies that Nicole had already sold = 4 tubs

Number of cookies sold by Josie before counting = 0 cookies

Nicole now sells 5 tubs per day and

Josie now sells 6 tubs per day.

Let the number of days it will take for them to have sold the same amount of cookies be d.

Thus;

5d + 4 = 6d + 0

6d - 5d = 4

d = 4 days

Thus, total number of cookies for both are;

Total for Nicole = 4 + 5(4) = 24 cookies

Total for Josie = 6(4) = 24 cookies

Read more about proportion at; brainly.com/question/870035

6 0
3 years ago
provides steady-state operating data for a solar power plant that operates on a Rankine cycle with Refrigerant 134a as its worki
Vaselesa [24]

Answer:

hello some parts of your question is missing attached below is the missing part ( the required fig and table )

answer : The solar collector surface area = 7133 m^2

Explanation:

Given data :

Rate of energy input to the collectors from solar radiation = 0.3 kW/m^2

percentage of solar power absorbed by refrigerant = 60%

Determine the solar collector surface area

The solar collector surface area = 7133 m^2

attached below is a detailed solution of the problem

8 0
3 years ago
Other questions:
  • A power plant burns natural gas to supply heat to a heat engine which rejects heat to the adjacent river. The power plant produc
    11·1 answer
  • Basic concepts surrounding electrical circuitry?​
    8·1 answer
  • The displacement of a certain object is described by y(t) = 23 sin 5t, where t is measured in seconds. Compute its period and it
    9·1 answer
  • Which option explains why Tyler is impressed in the following scenario?
    10·2 answers
  • What have you learned from the previous lesson? Let's try to check your prior knowledge
    9·1 answer
  • Các đặc điểm chính của đường dây dài siêu cao áp .
    10·1 answer
  • -Electronic control modules can easily evaluate the voltage and current levels of circuits to which they are connected and deter
    15·1 answer
  • Need help please????????!!!!!!
    5·1 answer
  • 48/64 reduced to its lowest term
    5·2 answers
  • How can we love our country? Not by words but by deeds. - Jose P. Laurel
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!