+ 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());

9th Sep 2021, 6:48 PM
Светлана Томилина
Светлана Томилина - avatar
3 odpowiedzi
+ 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())
9th Sep 2021, 9:50 PM
Abhay
Abhay - avatar
+ 1
Abhay, my answer was wrong. I've removed it.
9th Sep 2021, 10:04 PM
Simon Sauter
Simon Sauter - avatar
+ 1
Thank you!
10th Sep 2021, 11:50 AM
Светлана Томилина
Светлана Томилина - avatar