|
发表于 2021-4-28 22:06:21
|
显示全部楼层
本楼为最佳答案
- >>> def o():
- def i():
- print('哈哈哈')
- return i
- >>> o()
- <function o.<locals>.i at 0x0000018DB17C9700>
- >>> o()()
- 哈哈哈
- >>> help(o)
- Help on function o in module __main__:
- o()
- >>> help(o())
- Help on function i in module __main__:
- i()
- >>> help(o()())
- 哈哈哈
- Help on NoneType object:
- class NoneType(object)
- | Methods defined here:
- |
- | __bool__(self, /)
- | self != 0
- |
- | __repr__(self, /)
- | Return repr(self).
- |
- | ----------------------------------------------------------------------
- | Static methods defined here:
- |
- | __new__(*args, **kwargs) from builtins.type
- | Create and return a new object. See help(type) for accurate signature.
复制代码
照着写,然后用心品味一下出现的文字 |
|