为什么我的编译器里运行的时候会报错
# coding=utf-8
"""
函数的实质与属性
1.函数是一个对象
2.函数执行完成后内部变量回收
3.函数属性
4.函数返回值
"""
passline = 60
def func(val):
if val >= passline:
print('pass')
else:
print('faled')
def in_fun():
print(val)
in_fun()
return in_fun()
f = func(89)
f()
print(f.__closure__)
错误提示:
C:\Python27\python.exe C:/Users/vn7/PycharmProjects/Zlib/utils/base/function.py
Traceback (most recent call last):
pass
File "C:/Users/vn7/PycharmProjects/Zlib/utils/base/function.py", line 21, in <module>
89
f()
89
TypeError: 'NoneType' object is not callable
Process finished with exit code 1