From 6d8dcd8af7b6cba0aa1fba25a08c9b6640e68fcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20A=2E=20P=C3=A9rez=20Garay?= Date: Tue, 11 Aug 2020 02:36:22 -0500 Subject: [PATCH] Completed exercise decorators --- html_decorators.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/html_decorators.py b/html_decorators.py index 8d9c421..3127069 100644 --- a/html_decorators.py +++ b/html_decorators.py @@ -1,22 +1,32 @@ def div(func): # You have to code here! - pass + def wrapper(*args, **kwargs): + result = func(*args, **kwargs) + return f'
{result}
' + + return wrapper def article(func): # You have to code here! - pass - + def wrapper(*args, **kwargs): + return f'
{func(*args, **kwargs)}
' + + return wrapper + def p(func): # You have to code here! - pass + def wrapper(*args, **kwargs): + return f'

{func(*args, **kwargs)}

' + return wrapper # Here you must apply the decorators, uncomment this later # @div # @article # @p +@p def saludo(nombre): return f'¡Hola {nombre}, ¿Cómo estás?'