Python’s object-oriented programming system supports all four features: encapsulation, abstraction, inheritance and polymorphism.

Python is an amazing programming language that supports both the functional programming paradigm and object-oriented programming paradigm. A Python programmer, be it a software developer or a machine learning engineer or something else, is expected to be familiar with object-oriented programming. Python‘s object-oriented programming system supports all the four fundamental features of a general OOPS framework: encapsulation, abstraction, inheritance and polymorphism. We will have a quick look and hands-on practice on these features in this tutorial.

What is a Class and an Object?

Python, similar to any other object-oriented language, enables creating objects by defining classes. The most common data types of Python, such as strings, lists, dictionaries, etc., are in-built Python classes. A class is a bundle of instance variables and related methods meant for defining a type of object. A class can be viewed as a blueprint or a template of the objects. Variables of a class are usually termed as attributes. An object is an instance of a class with a specific set of attributes. Thus, one can create as many objects as needed from the same class. Coding examples in the sequel will give a better understanding of a class and objects.

#python #oop

Object-Oriented Programming with Python
2.10 GEEK