Question: The program must be completed using python ONLY The program must contain and use a main function that is called inside of: If_name_ _main_: Create
The program must be completed using python ONLY
The program must contain and use a main function that is called inside of: If_name_ _main_": Create one file called "yourStudentid.py" that contains two classes, the PropertyClass and the DecoratorClass PropertyClass Variables Functions get_value set_value del_value value The PropertyClass should be initialized with and take in one variable called "value". It should default to 0 if nothing is passed to it The class should have: A getter function for value that will print out "Getting Value" and then return value A setter function for value that will print out "Setting Value" and then set the value A deleter function for value that will print out "Deleting Value" and then delete the value These three functions must then be passed into a property named value The DecoratorClass should be initialized with and take in one variable called "value". It should default to O if nothing is passed to it The class should have: A getter function for value that will print out "Getting Value" and then return value A setter function for value that will print out "Setting Value" and then set the value A deleter function for value that will print out "Deleting Value" and then delete the value These three functions must use the @property decorator to specify whether they are a getter, setter, or deleter (Refer to slide 40 of Lecture 8's PowerPoint) The output should look like this: Propertyclass getter, setter, and deleter Setting Value Getting Value Setting Value Getting Value 10 Deleting Value DecoratorClass getter, setter, and deleter Setting Value Getting Value Setting Value Getting Value 10 Deleting Value Process returned e (exe) Press any key to continue execution time : e.084 s
Step by Step Solution
3.49 Rating (156 Votes )
There are 3 Steps involved in it
To create a Python program containing PropertyClass and DecoratorClass both implementing getter sett... View full answer
Get step-by-step solutions from verified subject matter experts
