Python - Encapsulation and Data Protection
Given this class:
How can you access the private attribute __data from outside the class without using the get_data method?
class C:
def __init__(self):
self.__data = 42
def get_data(self):
return self.__data
c = C()How can you access the private attribute __data from outside the class without using the get_data method?
