My Blog

My WordPress Blog

My Blog

My WordPress Blog

Day: October 3, 2024

Inner Classes

Inner Class in Python A class defined inside another class is known as an inner class in Python. Sometimes inner class is also called nested class. If the inner class is instantiated, the object of inner class can also be used by the parent class. Object of inner class becomes one of the attributes of the outer […]

Packages

In Python, the module is a Python script with a .py extension and contains objects such as classes, functions, etc. Packages in Python extend the concept of the modular approach further. The package is a folder containing one or more module files; additionally, a special file “__init__.py” file may be empty but may contain the package list. Create a Python Package Let us […]

Interfaces

In software engineering, an interface is a software architectural pattern. It is similar to a class but its methods just have prototype signature definition without any executable code or implementation body. The required functionality must be implemented by the methods of any class that inherits the interface. The method defined without any executable code is known as […]

Encapsulation

Encapsulation is the process of bundling attributes and methods within a single unit. It is one of the main pillars on which the object-oriented programming paradigm is based. We know that a class is a user-defined prototype for an object. It defines a set of data members and methods, capable of processing the data. According to the principle of […]

Abstraction

Abstraction is one of the important principles of object-oriented programming. It refers to a programming approach by which only the relevant data about an object is exposed, hiding all the other details. This approach helps in reducing the complexity and increasing the efficiency of application development. Types of Python Abstraction There are two types of abstraction. One […]

Dynamic Typing

One of the standout features of Python language is that it is a dynamically typed language. The compiler-based languages C/C++, Java, etc. are statically typed. Let us try to understand the difference between static typing and dynamic typing. In a statically typed language, each variable and its data type must be declared before assigning it a value. […]

Dynamic Binding

In object-oriented programming, the concept of dynamic binding is closely related to polymorphism. In Python, dynamic binding is the process of resolving a method or attribute at runtime, instead of at compile time. According to the polymorphism feature, different objects respond differently to the same method call based on their implementations. This behavior is achieved through method overriding, where a subclass […]

Method Overloading

Method overloading is a feature of object-oriented programming where a class can have multiple methods with the same name but different parameters. To overload method, we must change the number of parameters or the type of parameters, or both. Method Overloading in Python Unlike other programming languages like Java, C++, and C#, Python does not support […]

Polymorphism

What is Polymorphism in Python? The term polymorphism refers to a function or method taking different forms in different contexts. Since Python is a dynamically typed language, polymorphism in Python is very easily implemented. If a method in a parent class is overridden with different business logic in its different child classes, the base class method is […]

Scroll to top