Python - Encapsulation and Data Protection
What is the error in this code snippet?
class B:
def __init__(self):
self.__val = 5
b = B()
print(b.__val)class B:
def __init__(self):
self.__val = 5
b = B()
print(b.__val)15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions