All members in a Python class are public by default.
Access Modifier | Notation | Meaning
----- | ----- | -----
public | | Public members are accessible from outside the class.
protected | add a prefix _ (single underscore) to the member | Protected members of a class are accessible from within the class and are also available to its subclasses.
private | add a prefix __ (double underscore ) to the member | Private members can only be accessed inside the class
```
class Cls:
#constructor is defined
def __init__(self, a, b, c):
self.a = a # public Attribute
self._b = b # protected Attribute
self.__c = c # private Attribute
def f(self): # public method
self.__c *=2
pass
def _f(self): # protected method
self.__f()
pass
def __f(self): #private method
pass
cls = Cls(1, 2, 3)
print(cls.a)
print(cls._b)
cls.f()
cls._f()
```