From 5221ac91e10d30d39fa7f2cfc4c30d2995920c4f Mon Sep 17 00:00:00 2001 From: Jair Aguilar Date: Sun, 5 Jul 2020 08:20:14 -0500 Subject: [PATCH] Solved Challenge --- .gitignore | 1 + html_decorators.py | 25 ++++++++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index b6e4761..0af027c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ __pycache__/ *.py[cod] *$py.class +.vscode # C extensions *.so diff --git a/html_decorators.py b/html_decorators.py index 8d9c421..d40e5ca 100644 --- a/html_decorators.py +++ b/html_decorators.py @@ -1,22 +1,37 @@ def div(func): # You have to code here! - pass + def wrapper(*args): + + print(f'
{func(*args)}
') + + + return wrapper def article(func): # You have to code here! - pass + def wrapper(*args): + + print(f'
{func(*args)}
') + + + return wrapper def p(func): # You have to code here! - pass + def wrapper(*args): + + print(f'

{func(*args)}

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