How to make a chain of function decorators?

How can I make two decorators in Python that would do the following?

…which should return:

I’m not trying to make HTML this way in a real application – just trying to understand how decorators and decorator chaining works.


Check out the documentation to see how decorators work. Here is what you asked for: