Problem scenario
You know about encapsulation. You know about private methods that are only accessible from inside a class — not outside. You want to encapsulate a method in a class in Python. How do you write such a program?
Solution
“Programmers are most effective if shielded from, not exposed to, the innards of modules not their own.” (This was taken from page 272 of The Mythical Man-Month.)
Here is an example;
…