coderz.py

Keep Coding Keep Cheering!

@property Decorator in Python

The @property decorator in Python is used to define a method as a “getter” for the boundaries of a class attribute. It allows you to define a method that is accessed like an attribute, without needing to invoke it like a method. Here’s an example: In this example, the @property decorator is used to define […]

January 17, 2023 | python | No comments

Python Decorators

In Python, a decorator is a special kind of function that modifies the behavior of another function. Decorators are often implemented as closures, which are nested functions that can remember and access variables from their containing function, even after the containing function has finished executing. But before diving deep into decorators let us understand some […]

January 17, 2023 | python | No comments

Advertisement