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: Boolean [Data Type]

There are 2 built-in Boolean objects in Python- If we convert any other data type to Boolean, it will be either True or False. Create Boolean We can use the “bool” function to create a boolean. If no param is provided then it returns false- Output: Or we can just assign a Boolean value – … 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.

Python: Dictionary [Data Type]

Dictionary in Python is a collection of key/value pairs. Dictionaries use keys(labels) to store item/value references, instead of numbered index. Python Dictionary is a unordered and mutable collection of Zero(0) or more key/value pairs. Only hashable objects can be used as key in a Dictionary. Dictionary items are not ordered, and are not stored in … Read more

Python: List [Data Type]

List in Python is a data type that stores a collection of data, of one or more types. Python list is mutable. Lists are ordered collections of items. Items in the list store the order of each item.

Python: Integer [Data Type]

Integer in Python represents whole numbers, without any fractional part. An integer can be positive, negative, or zero. NOTES Max size of an integer in Python depends on the memory of the machine. Integers can be very large in Python, though working with a very large integer will be very slow. If the integer in … Read more