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

Python: Mathematical Operators

Operator Description + Addition – Subtraction * Multiplication / Division // Floor division ** Power % Reminder Addition Output: Subtraction Output: Multiplication Output: Division Output: Floor Division Output: Reminder Output: Power Output: Precedence of Mathematical Operators Not all operators have the same precedence. Based on the operators’ priority/precedence, the evaluation sequence will change. Let’s check … Read more

Python: Generator

Generator is a special type of function that produces a series of values over time. That means we can use a generate and get a value, then stop, and later get the next value. This is the process of lazy generation of sequence of values.