def upper_case_decorator(in_arg):
upper_word = in_arg() # please keep () after in_arg because we are passing function name as input
result = upper_word.upper()
return result
@upper_case_decorator
def random_var():
return "asdfg"
var = random_var()
print(var)
I am trying to implement decorator concept in the above python programming. But , when I run the code, I am facing : TypeError: 'str' object is not callable.
I do not know why I am facing this error. Could anyone help me ?