What is encapsulation in any language? Put simply, we encapsulate mainly to prevent mistakingly altering data. For example, private methods and variables.<p><pre><code> Class Foo:
def __init__(self):
self.__im_private()
def bar(self):
print('baz')
def __im_private(self):
print('back off, I can only be called by the class')</code></pre>