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
The speed of an aircraft is given to be 260 m/s in air. If the speed of sound at that location is 330 m/s, the flight of the air
navik [9.2K]

Answer:

Ma=\frac{260}{330} \\Ma=0.7878

So, Ma < 1  Flow is Subsonic

Explanation:

Mach Number:

Mach Number is the ratio of speed of the object to the speed of the sound. It is used to categorize the speed of the object on the basis of mach number as sonic, supersonic and hyper sonic. (It is a unit less quantity)

Mach < 1       Subsonic

Mach > 1       Supersonic

Ma= Speed of the object/Speed of the sound

Ma=\frac{260}{330} \\Ma=0.7878

So, Ma < 1 Flow is Subsonic

8 0
3 years ago
What is the angular velocity (in rad/s) of a body rotating at N r.p.m.?
Darina [25.2K]

Answer:

0.1047N

Explanation:

To solve this problem we must remember the conversion factors, remembering that 1 revolution equals 2π radians and 1min equals 60s

N\frac{rev}{min} \frac{2\pi }{1rev} \frac{1min}{60} =N\frac{2\pi }{60} =0.1047N

in conclusion, to know how many rad / s an element rotates which is expressed in Rev / min we must only multiply by 0.1047

3 0
3 years ago
Suppose you have two arrays: Arr1 and Arr2. Arr1 will be sorted values. For each element v in Arr2, you need to write a pseudo c
brilliants [131]

Answer:

The algorithm is as follows:

1. Declare Arr1 and Arr2

2. Get Input for Arr1 and Arr2

3. Initialize count to 0

4. For i in Arr2

4.1 For j in Arr1:

4.1.1 If i > j Then

4.1.1.1 count = count + 1

4.2 End j loop

4.3 Print count

4.4 count = 0

4.5 End i loop

5. End

Explanation:

This declares both arrays

1. Declare Arr1 and Arr2

This gets input for both arrays

2. Get Input for Arr1 and Arr2

This initializes count to 0

3. Initialize count to 0

This iterates through Arr2

4. For i in Arr2

This iterates through Arr1 (An inner loop)

4.1 For j in Arr1:

This checks if current element is greater than current element in Arr1

4.1.1 If i > j Then

If yes, count is incremented by 1

4.1.1.1 count = count + 1

This ends the inner loop

4.2 End j loop

Print count and set count to 0

<em>4.3 Print count</em>

<em>4.4 count = 0</em>

End the outer loop

4.5 End i loop

End the algorithm

5. End

6 0
3 years ago
Affordability is most concerned with:
leva [86]

Answer:

feasibility study

Explanation:

7 0
3 years ago
You can assume there is no pressure drop between the exit of the compressor and the entrance of the turbine. All the power from
Eddi Din [679]

Answer:

s6rt5x11j4fgu

j4

cf53yhu5

y4

hh

Explanation:

j

6 0
3 years ago
Other questions:
  • Is a 68.75 and a 70 a pass in 5th grade?
    10·2 answers
  • Under EPA's regulations, which of the following methods can be used to pressurize an R11 or R123 system for the purpose of openi
    11·1 answer
  • Do you think the mining process is faster when you know in advance that the land must be restored? Explain.
    14·1 answer
  • Describe what viscoelastic behavior means
    7·1 answer
  • PLEASE HELP ASAP!!! Thanks
    11·1 answer
  • State 3 advantages and 3 disadvantages of unit rate contract​
    10·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
  • In python, how would I randomize numbers and insert them into a file?
    7·1 answer
  • Please help me on this it’s due now
    14·1 answer
  • What is chemical engieering ?​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!