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 16:30
You have inserted new slides based on a word outline. how do you format these new slides to match the powerpoint presentation formatting? a. select all slides in the presentation and click format on the home tab. b. select the new slides and click reset on the home tab. c. select all slides in the presentation and click reset on the home tab. d. select the new slides and click format on the home tab.
Answers: 2
question
Computers and Technology, 23.06.2019 09:00
The first screen you see when you open word2016 what is called?
Answers: 1
question
Computers and Technology, 23.06.2019 11:30
Me dangers of social media and the internetexplain what each means: 1) social media and phones have become an addiction.2) outside people have access to you all the time.3) cyberstalking4) cyberbullying5) catphishing6) viruses7) identity theft8) credit card fraud9) hacking10) money schemes
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
*! 20 points! *jeff wants to create a website with interactive and dynamic content. which programming language will he use? a. dhtml b. html c. css d. javascript
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
Chemistry, 29.02.2020 11:27
question
Biology, 29.02.2020 11:28
question
Mathematics, 29.02.2020 11:28
question
Chemistry, 29.02.2020 11:29
question
Biology, 29.02.2020 11:33
question
Mathematics, 29.02.2020 11:34
question
Mathematics, 29.02.2020 11:36
question
Mathematics, 29.02.2020 11:40
Questions on the website: 13722363