fork download
  1. def decorator(func):
  2. def wrapper():
  3. print("Before function call")
  4. func()
  5. print("After function call")
  6. return wrapper
  7.  
  8. @decorator
  9. def say_hello():
  10. print("Hello!")
  11.  
  12. say_hello()
  13.  
Success #stdin #stdout 0.01s 7108KB
stdin
10
aba
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks
stdout
Before function call
Hello!
After function call