Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions html_decorators.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
def div(func):
# You have to code here!
pass
def wrapper(*args, **kwargs):
return '<div>'+func(*args, **kwargs)+'</div>'
return wrapper


def article(func):
# You have to code here!
pass
def wrapper(*args, **kwargs):
return '<article>'+func(*args, **kwargs)+'</article>'
return wrapper


def p(func):
# You have to code here!
pass
def wrapper(*args, **kwargs):
return '<p>'+func(*args, **kwargs)+'</p>'
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?'

Expand Down