Jun-18-2021, 09:13 PM
Hello Community,
I’m having trouble understanding why the following query fails. I’ve run this in the editor a few times but it’s still not clicking conceptually. It returns the following error message “AttributeError: ‘A’ object has no attribute ‘__a’”
Can someone please help me understand?
I’m having trouble understanding why the following query fails. I’ve run this in the editor a few times but it’s still not clicking conceptually. It returns the following error message “AttributeError: ‘A’ object has no attribute ‘__a’”
Can someone please help me understand?
class A: def __init__(self, v): self.__a = v + 1 a = A(0) print(a.__a)