Does Python support encapsulation?

Initially programming was only done with the help of Logics and Function but with the passage of time  as the programmings grew bigger and bigger, that idea lead to lot of redundant code/modules and maintainability became a big problem. Then People understood the importance of data and how to manage data became an important topic That is how OOPs paradigm came into existence and became widely popular.

Now moving into the core topic that is Encapsulation supported in Python.But before we discuss it we first will try to understand what actually Encapsulation is.Encapsulation is the process and one of the main pillars of Object Oriented Programming which allows programmer to wrap data and code in a single unit.So Why it is useful.It increases the security of the code.Now the question arises how We can implement Encapsulation in Python.We can implement encapsulation by using private access modifier and we can get or set data from or to that classes with the help of Getter and Setter methods.Python doesn't support Encapsulation directly but still you can implement it.

Thanks for Reading

Comments

  1. The way of explanation and the questions in between explanation and there answers clear my all doubts.
    KAVI
    Thanks

    ReplyDelete

Post a Comment

Popular posts from this blog

5 Best Java frameworks

Collections — Container Datatypes - Python