[solved]what i have to do to fix the error of this code?
it gives an UnboundlocalError, i cant understand what is the mistake i have done. num1 = int(input()) opr = input() numx = int(input()) oprx = input() def operator_check() : if str(opr) in opr_list : return opr_list[str(opr)] else : pass def add() : if oprx == "=" : numx += num1 return numx elif str(oprx) == "+" : numx += num1 return operator_check() else : pass def sub() : if oprx == "=" : numx -= num1 return numx elif oprx == "-" : numx -= num1 return operator_check() else : pass def mult() : if oprx == "=" : numx *= num1 return numx elif oprx == "*" : numx *= num1 return operator_check() else : pass def div() : if oprx == "=" : numx /= num1 return numx elif oprx == "/" : numx /= num1 return operator_check() else : pass def factorial(num1) : if num1 == 1 : return 1 else : return num1*factorial(num1-1) def expo() : if oprx == "=" : numx **= num1 elif oprx == "**" : numx **= num1 return operator_check() else : pass def sqrt() : if numx == "sqrt" : num1 = num1 ** (1/2) return num1 opr_list = {"+": add(),"-": sub(),"*": mult(),"/": div(),"!": factorial(num1),"**": expo(),"sqrt": sqrt()} operator_check()