Enterra Solutions interview question

In Python, what is a decorator and how does it work? What are the two ways to implement a decorator (function and class)? What is the use case for a decorator?