|
@@ -59,13 +59,36 @@ def one_more_func(name, surname):
|
|
return f'Hello {name} {surname}'
|
|
return f'Hello {name} {surname}'
|
|
|
|
|
|
|
|
|
|
|
|
+def repeater(func):
|
|
|
|
+ def wrapper(*args, **kwargs):
|
|
|
|
+ func(*args, **kwargs)
|
|
|
|
+ func(*args, **kwargs)
|
|
|
|
+ func(*args, **kwargs)
|
|
|
|
+ return wrapper
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+def text_decor(func):
|
|
|
|
+ def inner(*args, **kwargs):
|
|
|
|
+ print('Hello')
|
|
|
|
+ return func(*args, **kwargs)
|
|
|
|
+ print('Goodbye!')
|
|
|
|
+ return inner
|
|
|
|
+
|
|
|
|
+@text_decor
|
|
|
|
+def multiply(num1, num2):
|
|
|
|
+ print(num1 * num2)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
def main():
|
|
def main():
|
|
# res = say_hello_to('Vasya', 'Ivanov')
|
|
# res = say_hello_to('Vasya', 'Ivanov')
|
|
# print(f'{res=}')
|
|
# print(f'{res=}')
|
|
|
|
|
|
- res = one_more_func("gennadi", "LOSKOV")
|
|
|
|
- print(f'{res=}')
|
|
|
|
|
|
+ # res = one_more_func("gennadi", "LOSKOV")
|
|
|
|
+ # print(f'{res=}')
|
|
|
|
|
|
|
|
+ print(multiply(3, 5))
|
|
|
|
|
|
|
|
|
|
|
|
|