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
26 changes: 19 additions & 7 deletions html_decorators.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
# <div> function
def div(func):
# You have to code here!
pass

def div_print(*args):
return f'<div>{ func(*args) }</div>'

return div_print


# <article> function
def article(func):
# You have to code here!
pass

def article_print(*args):
return f'<article>{ func(*args) }</article>'

return article_print


# <p> function
def p(func):
# You have to code here!
pass

def p_print(*args):
return f'<p>{ func(*args) }</p>'

return p_print


# Here you must apply the decorators, uncomment this later
# @div
@div
# @article
# @p
def saludo(nombre):
Expand Down