Decorator takes a function as an argument, adds some functionality and returns it. Generally, decorators are used when we need to add some functionality to the existing code.