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.
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.
Getters and setters work as the entry point for managing and manipulating data for an object of a class. In this article, we are discussing the getter, setter, and deleter for the property of a Python class.
We can use a floating point number to represent a decimal number. In Python we can represent 3 types of floating values- NOTES All these 3 types are immutable. That means when any of the above types of data is created in memory, it is never changed. Reassigning a new value to any of the … Read more
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.
A Python Set is unordered collection of Zero or more hashable unique object references.
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
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.
Tuple is an immutable and ordered collection of items. A tuple is similar to a list, but the items can not be changed, once the tuple is created.
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
What is a String? String in Python is- Examples of String Create String Use “str” function to create a new string. If no value is provided to “str” function then an empty string is created- Output: We can wrap a sequence of characters with single or double quotes to define a string literal. Output: Multi-line … Read more