What is wrong with this code? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
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 ?

14th May 2019, 3:18 AM
Debraj Singh
Debraj Singh - avatar
2 Antworten
+ 1
Thanks return function(*args,**kwargs) worked
14th May 2019, 3:38 AM
Debraj Singh
Debraj Singh - avatar
0
return func(*args, **kwargs) return "Access Denied"
14th May 2019, 3:32 AM
Diego
Diego - avatar