Decorators on python

can someone explain me again what is decorators and why do we use them?

Hello Roshan, decorators are the special functionality provided in python. See the decorators are a way to add functionality to your function without writing the same thing again and again.
It makes your work easy and saves memory.
As sometimes it’s like you can save a lot of files and memory as you don’t have to write that same redundant functions again and again. Take it like you are calling a function within a function.
If you have seen the video in that also sir created a func and pass the another func into that so that it can achieve the functionality for asking the login/password every time we run it.

I hope it will be clear to you in case there is any difficulty pls let me know I will help you out.
And if it is clear pls mark it as resolve and provide the rating/feedback so that we can improve ourselves.
Thanks :slight_smile:
Happy Coding !!

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.