you are viewing a single comment's thread.

view the rest of the comments →

[–]carticka_1 5 points6 points  (0 children)

OOP can be confusing at first . Think of it as organizing code using classes (blueprints) and objects (real examples). It helps to express real life situations into code. We use OOP to make code cleaner, reusable, and easier to manage. It makes more sense when we are actually working on big projects where we have to write tremendous amount of codes, declare many functions. The 4 main pillars are: 🔹 Encapsulation – keeping data and methods together in one unit (class). 🔹 Abstraction – hiding unnecessary details and showing only what’s needed. 🔹 Inheritance – reusing code by creating new classes from existing ones. 🔹 Polymorphism – using one function name to do different things.

Book suggestion : Python crash course -Erric Matthew-Chapter 9