Question: PYTHON!!!! THANK YOU Create a StateData2 class with the following method: __init__. The __init__ method should have the parameter self. It should store the value
PYTHON!!!! THANK YOU
Create a StateData2 class with the following method: __init__.
The __init__ method should have the parameter self. It should store the value "Public" in an attribute called public, the value " Protected" in an attribute called _protected (use a single underscore), and the value " Private" in an attribute called __private (use a double underscore).
Test the class by creating an instance of the class called test.
Try to print three lines: test.public, test._protected, test.__private
Sample Execution Results:
Public Protected Traceback error
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
