+ 1
Помогите с декоратором / help with decorator
Код не работает, пожалуйста помогите исправить\ please help, the cod don’t work: def decor (func): def wrap(): print ("***") func() print ("*** \nEND OF PAGE") return wrap @decor def invoice(number): print("INVOICE #"+number) invoice(input());
3 ответов
+ 2
Correct code,
def decor (func):
def wrap(num):
print ("***")
func(num)
print ("*** \nEND OF PAGE")
return wrap
@decor
def invoice(number):
print("INVOICE #"+number)
invoice(input())
+ 1
Abhay, my answer was wrong. I've removed it.
+ 1
Thank you!