TypeError: 'NoneType' object is not callable--python报错

报错为
在这里插入图片描述
翻译过来为:TypeError:“NoneType”对象不可调用
代码:

def bibao_one():
    Jay = "哎哟不错哦"
    def bibao_two():
        print(Jay)

    return bibao_two()

#执行闭包
execute = bibao_one()

execute()

我们在执行调用函数的时候,把括号去掉就是了,如
在这里插入图片描述

原创文章 96 获赞 330 访问量 2万+

猜你喜欢

转载自blog.csdn.net/hanhanwanghaha/article/details/106078661
今日推荐