Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. def print_my_name(name):
  2.     print(f'My name is {name}')
  3.  
  4. nm = 'Teodor"
  5. output:
  6. My name is Teodor
  7. ###################################
  8. def decorate_it(function):
  9.     def wrap_it(arg):
  10.         print('Adding more')
  11.        func(arg)
  12.        print('Adding more')
  13.    return wrap_it
  14.  
  15. nm = 'Teodor'
  16. @decorate_func
  17. def print_my_name(name):
  18.    print(f'My name is {name}')
  19.  
  20. print_my_name(nm)
  21.  
  22. output:
  23. Adding more
  24. My name is Teodor
  25. Adding more
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement