Python: Lambda Function

Start with the keyword “lambda”. Then put the list of parameters, which are separated by commas. Put colon(:) after that. Finally, write the return value or expression. Only one expression can be here, which is returned.

Python: Decorator

A decorator is a function that accepts a function and returns a function. We can perform the additional steps of operation(that we want to add before/after the original function), in the implementation of the decorator.

Python: Class and Object

An object in Python(and in general OOP) is a collection of data, and the behavior associated with the different aspects of the object. Object-Oriented Programming(OOP) refers to, objects being the primary focus while programming and modeling all real-world entities as objects. So when we analyze a problem, we need to identify 2 things- Class is … Read more