PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#what if i need both functions with and without decorator
def decorator(func):
def new_fun():
print("Hi from decorator")
print("before func call")
func()
print("after func call")
return new_fun
@decorator
def myfunc():
print("Hi from function")
#ok
myfunc()
print('\n')
#how to have this without decorator
myfunc()
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run