Skip to content

Reto 4 completed #38

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
30 changes: 20 additions & 10 deletions html_decorators.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
def div(func):
# You have to code here!
pass
def wrapper(*args, **kwargs):
strx = func(*args, **kwargs)
strx = f'<div> {strx} </div>'
return strx
return wrapper


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


def p(func):
# You have to code here!
pass
def wrapper(*args, **kwargs):
strx = func(*args, **kwargs)
strx = f'<p> {strx} </p>'
return strx
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 All @@ -28,7 +38,7 @@ def run():
if __name__ == '__main__':
run()

# We want to have three different outputs 👇🏼
# We want to have three different outputs 👇🏼

# <div>¡Hola Jorge, ¿Cómo estás?'</div>
# <article>¡Hola Jorge, ¿Cómo estás?'</article>
Expand Down