Nitin, a junior of mine from college, had been programming for quite a long time, Till now, he had only been using functions and subroutines as a way to program his applications. Recently, he decided to switch to an Object-Oriented approach to programming and sought my help in understanding the nitty-gritty of the same. In this article, I try to explain the essentials of an Object-Oriented Programming via a conversation that took place between me and Nitin.

**Keywords **— Objects, Classes, Attributes, Instance, Methods.

Me:_ Nitin, why are you so interested in learning Object-Oriented Programming, What is the problem with Procedure Oriented Programming?_

**Nitin:**I find it quite difficult to structure and modularize my code. Even for a slightly different task, I have no option but to rewrite the code from scratch. Also, apart from the reusability issues, I also find it difficult to debug the code.

**_Me: _**Yes, you are right, those are some limitations with a procedure way of programming. But Don’t worry, we have Object-Oriented Programming to the rescue.

_Nitin: _So, What is Object-Oriented Programming (OOP)?

_Me: _OOP is basically a way of programming that concentrates on utilizing & implementing Objects and Classes to design/write a particular application.

  • An Object is a datatype that follows a certain structure/Outline which can store data and can manipulate the data based on certain operations.
  • Class is a kind of Outline/Template of the Object. These Classes define how an object behaves in a program using Methods.
  • Attributes are the properties/characteristics of an Object or a Class. All objects are said to be an instance of some class.

#programming #data-science #python3 #python

Understanding the Crux of Objects and Classes in Python
3.30 GEEK