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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:00
1. so if i wanted to build a linux server for web services(apache) with 1cpu and 2 gb of memory.-operating at 75% of memory capacity2. a windows server with 2 cpu/ 4gb memory- operating at 85% of memory capacity3. a storage server with 1 cpu/ 2gb memory- operating at 85% of memory capacityhow much memory do i have to add for each server.so that the utilization rate for both cpu and memory is at a baseline of 60%."the details for the cpu like its processor or the memory's speed isnt to be concerned" yeah i kept asking my teacher if he's even sure about the but the whole class seems to be confused and the project is due in 3 days..this is a virtualization project where i have to virtualize a typical server into an exsi hypervisor.
Answers: 2
question
Computers and Technology, 24.06.2019 02:00
What is a loop? a. a collection of function definitions at the top of a program b. a line of code that defines a variable and assigns it a value c. a program that opens the turtle graphics window d. a block of code that repeats a specific number of times
Answers: 1
question
Computers and Technology, 24.06.2019 15:30
What is the total number of time zones that can be configured to show by default in a calendar in outlook 2016?
Answers: 1
question
Computers and Technology, 24.06.2019 17:30
Click on the tab on the ribbon to open the backstage view. file view insert review
Answers: 1
You know the right answer?
In Python 3, write a decorator function that has the following property:

1. The name of...
Questions
question
Mathematics, 27.06.2021 04:40
question
Mathematics, 27.06.2021 04:40
question
Mathematics, 27.06.2021 04:40
question
Mathematics, 27.06.2021 04:50
question
Mathematics, 27.06.2021 04:50