private instance attribute python code example
Example: private instance attribute python
# Square Class: Define a Square with private instance
class Square:
def __init__(self, size=0):
# initialise variables
self.__size = size
# Square Class: Define a Square with private instance
class Square:
def __init__(self, size=0):
# initialise variables
self.__size = size