Decorators

Run Settings
LanguagePython
Language Version
Run Command
# is super boost a func. def some_decorator(func): def wrap_func(): print('********') func() print('********') return wrap_func @some_decorator def hello(): print('hellooo!') hello() from time import time def performance(fn): def wrapper(*args, **kwargs): t1 = time() result = fn(*args, **kwargs) t2 = time() print(f'took {t2 - t1} s') return result return wrapper @performance def long_time(): for i in range(1000000): i*5 long_time() #Excercise
Editor Settings
Theme
Key bindings
Full width
Lines