subject

In Python 3, write a decorator function that has the following property:

1. The name of the decorator is uppercase and takes a function as input.
2. The decorator has an inner function called wrapper with no input argument.
3. The wrapper function has two local variables: original and modified.
4. The input function argument of decorator gets assigned to the original variable inside the wrapper function and the upper case version of the input function gets assigned to the modified variable.
5. The wrapper function returns the modified variable.
6. The decorator returns the wrapper (per the usual of the inner functions in decorators)
7. Write a new function called greetings that prints "Hello".
8. Decorate the greetings function with the uppercase decorator function.
9. Run the program by invoking the greetings function. Record the output and include it with your code.
10. Save the decorator uppercase as a separate Python file and import it to a new file that defines the greetings function as a decorated function that simply prints the "Hello" message.
11. Generate the output by invoking the greetings function.

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 07:00, Dvrsug8598
You need a quick answer from a coworker. the most effective way to reach your coworker is through a. cloud server b. instant message c. teleconference d. telepresence
Answers: 1
image
Computers and Technology, 23.06.2019 07:30, jackie0833
Which option allows you to view slides on the full computer screen?
Answers: 1
image
Computers and Technology, 23.06.2019 09:20, lovely222
How to print: number is equal to: 1 and it is odd number number is equal to: 2 and it is even number number is equal to: 3 and it is odd number number is equal to: 4 and it is even number in the console using java using 1 if statement, 1 while loop, 1 else loop also using % to check odds and evens
Answers: 3
image
Computers and Technology, 23.06.2019 12:10, jefersina16
2. fabulously fit offers memberships for$35 per month plus a $50 enrollmentfee. the fitness studio offersmemberships for $40 per month plus a$35 enrollment fee. in how many monthswill the fitness clubs cost the same? what will the cost be?
Answers: 1
You know the right answer?
In Python 3, write a decorator function that has the following property:

1. The name of...

Questions in other subjects:

Konu
Mathematics, 25.02.2021 19:20
Konu
English, 25.02.2021 19:20
Konu
Mathematics, 25.02.2021 19:20
Konu
English, 25.02.2021 19:20