Learn more about Object Oriented Programming

Object-oriented programming (OOP) is a computer programming paradigm where a software application is developed by modeling real world objects into software modules called classes. Consider a simple point of sale system that keeps record of products purchased from whole-sale dealers and the products sold to the customer. An object-oriented language would implement these requirements by creating a Product class, a Customer class, a Dealer class and an Order class. All of these classes would interact together to deliver the required functionality where each class would be concerned with storing its own data and performing its own functions. This is the basic idea of object-oriented programming or also called OOP.

Frequently asked questions
Python is a multi-paradigm language, which means that it supports many programming approaches. Along with procedural and functional programming styles, Python also supports the object-oriented style of programming. In object-oriented programming, a developer completes a programming project by creating Python objects in code that represent objects in the actual world. These objects can contain both the data and functionality of the real-world object. To generate an object in Python you need a class. You can think of a class as a template. You create the template once, and then use the template to create as many objects as you need. Python classes have attributes to represent data and methods that add functionality. A class representing a car may have attributes like color, speed, and seats and methods like driving, steering, and stopping. The concept of combining data with functionality in an object is called encapsulation, a core concept in the object-oriented programming paradigm.