Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
oorrja
GitHub Repository: oorrja/learntosolveit
Path: blob/master/languages/python/design_decorator3.py
1240 views
1
#!/usr/bin/python
2
3
def my_decorator(fun):
4
def wrapper(*args):
5
print("Before Invocation")
6
fun(*args)
7
print("After Invocation")
8
return wrapper
9
10
@my_decorator
11
def hello_world(x):
12
print("Hello, World")
13
print(x)
14
15
hello_world(10)
16
17