• May 2, 2025

Private and Protected Variables and Methods

Representation of private and Protected Variables and Methods: This is mainly a message from one developer to another developer. The rule is not from Python.

Private Variable and Method represented with – – in front of variable or method name:
Private Variable: – -Var -> Private variable used inside a method (function)
Private Method: – -method() -> Private method inside a class

Protected Variable and Method represented with – in front of variable or method name:
Can be accessed in that class also in inherited class but not to be used in main()