diff --git a/html_decorators.py b/html_decorators.py index 8d9c421..97ae2fa 100644 --- a/html_decorators.py +++ b/html_decorators.py @@ -1,28 +1,34 @@ def div(func): - # You have to code here! - pass - + def wrapper(*args, **kwargs): + funci = func(*args, **kwargs) + print(f"
{funci}
") + return funci + return wrapper def article(func): - # You have to code here! - pass - + def wrapper(*args, **kwargs): + funci = func(*args, **kwargs) + print(f"
{funci}
") + return funci + return wrapper def p(func): - # You have to code here! - pass + def wrapper(*args, **kwargs): + funci = func(*args, **kwargs) + print(f"

{funci}

") + + return wrapper # Here you must apply the decorators, uncomment this later -# @div -# @article -# @p +@p +@article +@div def saludo(nombre): return f'¡Hola {nombre}, ¿Cómo estás?' - def run(): - print(saludo('Jorge')) + saludo('Jorge') if __name__ == '__main__': diff --git a/time_elapsed.py b/time_elapsed.py index 240f40c..f0e212c 100644 --- a/time_elapsed.py +++ b/time_elapsed.py @@ -1,4 +1,4 @@ -from datetime import datetime + from datetime import datetime def execution_time(func):