Python does not have access modifiers. If you want to access an instance (or class) variable from outside the instance or class, you are always allowed to do so. Python introduced a concept of prefixing the name of the method, function, or variable by using a double or single underscore to act like the behavior of private and protected access specifiers. But it doesn’t actually change access privilege.
Python does not have access modifiers. If you want to access an instance (or class) variable from outside the instance or class, you are always allowed to do so. Python introduced a concept of prefixing the name of the method, function, or variable by using a double or single underscore to act like the behavior of private and protected access specifiers. But it doesn’t actually change access privilege.
need an explanation for this answer? contact us directly to get an explanation for this answer