# Декоратор
# decorator function
def outer(func):
def inner():
str1 = func()
return str1.upper() # addition of functionality
return inner
@outer
def print_str():
return "good morning"
print(print_str())
# Output -> 'GOOD MORNING'
# A decorator is a function that takes another function as an argument, adds some kind of functionality to it and returns another function. Python decorators help add functionality to an existing code(function) which may aid in code reusability.
Impossible Impala