From e7dee7f268006df9090c428c75de2e4331a53999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel?= <20430676+supermavster@users.noreply.github.com> Date: Thu, 21 May 2020 23:27:31 -0500 Subject: [PATCH] [Challenge] Complete Python-04! --- html_decorators.py | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/html_decorators.py b/html_decorators.py index 8d9c421..fb04f6f 100644 --- a/html_decorators.py +++ b/html_decorators.py @@ -1,22 +1,36 @@ +# -*- codign: utf-8 -*- + def div(func): # You have to code here! - pass + def wrapper(*args, **kwargs): + element, data = 'div', func(*args) + print(f'<{element}>{data}') + return data + return wrapper def article(func): # You have to code here! - pass + def wrapper(*args, **kwargs): + element, data = 'article', func(*args) + print(f'<{element}>{data}') + return data + return wrapper def p(func): # You have to code here! - pass + def wrapper(*args, **kwargs): + element, data = 'p', func(*args) + print(f'<{element}>{data}') + return data + return wrapper # Here you must apply the decorators, uncomment this later -# @div -# @article -# @p +@div +@article +@p def saludo(nombre): return f'¡Hola {nombre}, ¿Cómo estás?'