Posts From Python OOPS

Polymorphism in Python

Polymorphism means having vivid or different forms. In the programming world, Polymorphism refers to the ability of the function with the same name to carry different functionality altogether. It creates a structure that can use many forms of objects. This permits functions/arguments to use entities of different types at different times. In object-oriented programming, Polymorphism allows a […]

Object-Oriented Programming in Python

Object-oriented programming (OOP) refers to the software design wherein programmers define the data type of a data structure, and the types of functions that can be applied to the data structure. This paradigm provides functionalities and behavior pattern to the structure of data. This paradigm maps and models real-world things together and describes a relationship among […]

Python Multiple Inheritance

When a class inherits from more than one class, it’s called multiple inheritances. Python supports multiple inheritances whereas Java doesn’t support it. The properties of all the super/base classes are inherited into the derived/subclass. Python Multiple Inheritance Syntax The syntax for Multiple Inheritance is also similar to the single inheritance. By the way, the derived […]

Inheritance in Python

Inheritance at a glance! In the world of Object-Oriented Programming (OOP), Inheritance refers to the mechanism of the capability of a class to derive or extend the properties from another class in the run. This property enables the derived class to acquire the properties or traits of the base class. Inheritance is considered one of […]

Python Class Constructor – Python __init__() Function

Python class constructor function job is to initialize the instance of the class. Python __init__() is the constructor function for the classes in Python. Python __init__() Function Syntax The __init__() function syntax is: The def keyword is used to define it because it’s a function. The first argument refers to the current object. It binds […]

Python Classes and Objects

Python is an object-oriented programming language. The classes and objects are at the core of implementing object-oriented programming model in Python What is a Python Class? A class is a blueprint from which objects are created. The classes can have properties and functions. For example, we can have a class Employee with employee_id as the […]