Protected members are accessible within the class and its subclasses.
To define a protected member, you prefix its name with a single underscore (_).
class MyClass:
def __init__(self):
self._protected_var = 42
def _protected_method(self):
print("This is a protected method")