内省
2018-12-03 本文已影响0人
庵下桃花仙
在变量名前后使用“?”,显示关于该对象的概要信息。(jupyter notebook)
def add_numbers(a, b):
"""
Add two numbers together
Returns
-------
the sum : type of arguments
"""
return a + b
add_numbers?
Signature: add_numbers(a, b)
Docstring:
Add two numbers together
Returns
-------
the sum : type of arguments
File: c:\users\dell\<ipython-input-1-a44112c7fc88>
Type: function
add_numbers??
Signature: add_numbers(a, b)
Source:
def add_numbers(a, b):
"""
Add two numbers together
Returns
-------
the sum : type of arguments
"""
return a + b
File: c:\users\dell\<ipython-input-1-a44112c7fc88>
Type: function