Pankaj Kumar

Pankaj Kumar

I have been working on Python programming for more than 12 years. At AskPython, I share my learning on Python with other fellow developers.

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 Python Multiple Inheritance Syntax The syntax…

Python Static Method

Python static method belongs to the Class. They are used to create utility methods for the class. The static method is called from the Class reference. They can’t change the state of the object since they belong to the class.…

Python main function Examples

The idea of Python main function is to execute some code only when the Python script is executed directly. The function should not execute when the same script is imported as a Python module in another program. How to Write…

Python ternary Operator Examples

Python doesn’t have a ternary operator. But, it supports writing an if-else statement in such a way that it works as a Python ternary operator. Why Python doesn’t have a special ternary operator? Many programming languages have ternary operators. But,…

Python Array – 13 Examples

Python doesn’t have explicit array data structure. It’s because we can do the same things with the List. The list contains a collection of items and it supports add/update/delete/search operations. That’s why there is not much use of a separate…