0
What is wrong with this code?
def decor (func): def wrapper(*args,**kwargs): password=input("Password:") If password=="12345": print("Access Granted") func(*args,**kwargs) else: print("Access Denied") return wrapper @decor def sum(a,b) return a+b print(sum(12,13) It's printing: Password:12345 Access Granted None I can't understand why it's printing None instead of 25 Can anyone suggest any improvement, or just tell me what is wrong with this code ?
2 Answers
+ 1
Thanks
return function(*args,**kwargs)
worked
0
return func(*args, **kwargs)
return "Access Denied"