None type error | Sololearn: Learn to code for FREE!

0

None type error

I tried decorated function in python 3.7.3 shell By using code def decor (func): def wrap( ): Print ("=========") func( ) Print ("=========") return wrap def text( ): print ("Ganesh") Decorated=decor(text) Decorated( ) But this shows typeerror: 'nonetype' in my system Can you suggest me what to do

5/18/2019 8:30:44 AM

Ganesh Babu

2 Answers

New Answer

+1

Thank you😁✌🏼

0

def decor(func): def wrap(): print("=========") func() print("=========") return wrap def text(): print("Ganesh") Decorated = decor(text) Decorated() Note the indentation level of "return wrap". In your code, the inner function wrap() is never called