Skip to content

Instantly share code, notes, and snippets.

@agusrichard
Last active January 23, 2021 16:55
Show Gist options
  • Save agusrichard/f92ed50497b495378c2ee17a8772b78a to your computer and use it in GitHub Desktop.
Save agusrichard/f92ed50497b495378c2ee17a8772b78a to your computer and use it in GitHub Desktop.
def do_ten_times(func):
"""Repeats func ten times"""
def wrapper():
for i in range(10):
func()
return wrapper
@do_ten_times
def say_hi():
print("Hiiiii....")
def introduce_myself(name):
print(f"Hi, my name is {name}")
print(say_hi.__name__)
# Returns: wrapper
print(introduce_myself.__name__)
# Return: introduce_myself
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment