How can i insert an input with decorator?
Hi! I have this code below and want to create an input with other function(just to understand better how decorators work). I tried my best, but i couldn`t understand how to call a variables from main function. Is there any possible solution for this problem? def imput(func): def wrap(a,b): a=input('define a: ') b=input('define b: ') return wrap(a,b) def smart_divide(func): def inner(a,b): print("I am going to divide",a,"and",b) if b == 0: print("Whoops! cannot divide") return return func(a,b) return inner def printer(func): def innner(a,b): print('the answer is',func(a,b)) return innner @imput @smart_divide @printer def divide(a,b): s=a/b return s divide()