human
I am working on the file "20170913_python_decorator_contextmanager/decorator_and_contextmanager.ipynb".
The first task is:
Decorator assignment (2)
既然 decorator 是包裝其他 function, 那 decorator 應該也可以包裝 decorator ?
Can you write Python code for it?
assistant
#Here is the Python code you requested.

from functools import wraps

def tag(name):
    def deco(func):
        @wraps(func)
        def wrapped(*args, **kwargs):
            print('<{}>'.format(name))
            func(*args, **kwargs)
            print('</{}>'.format(name))
        return wrapped
    return deco

tag_div = tag('div')
tag_p = tag('p')

@tag_div
@tag_p
def content(*args, **kwargs):
    for i in args:
        print(i)

content('Hello World.', 'This is second argument.')