如何运用JUPYTER NOTEBOOK的问号

 时间:2026-02-14 02:02:54

1、打开JUPYTER NOTEBOOK,新建一个空白的PY文档。

如何运用JUPYTER NOTEBOOK的问号

2、a = [2, 999, 3232]

a?

Type:        listString form: [2, 999, 3232]Length:      3Docstring:  list() -> new empty listlist(iterable) -> new list initialized from iterable's items

定义一个列表,列表加上问号,可以查看这个列表的详情。

如何运用JUPYTER NOTEBOOK的问号

3、?a

如果把问号放在前面也是一样的,根据个人习惯定义即可。

如何运用JUPYTER NOTEBOOK的问号

4、print?

Docstring:print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)Prints the values to a stream, or to sys.stdout by default.Optional keyword arguments:file:  a file-like object (stream); defaults to the current sys.stdout.sep:   string inserted between values, default a space.end:   string appended after the last value, default a newline.flush: whether to forcibly flush the stream.Type:      builtin_function_or_method

print是自带的function,也是可以用?查看用法。

如何运用JUPYTER NOTEBOOK的问号

5、def plus(x, y):

    'plus 2 numbers together'

    return x * y

plus?

Signature: plus(x, y)Docstring: plus 2 numbers togetherFile:      c:\users\danson\desktop\<ipython-input-20-e41ef1d43fd2>Type:      function

定义一个函数,也是可以查看该函数的信息。

如何运用JUPYTER NOTEBOOK的问号

6、plus??

Signature: plus(x, y)Source:   def plus(x, y):    'plus 2 numbers together'    return x * yFile:      c:\users\danson\desktop\<ipython-input-20-e41ef1d43fd2>Type:      function

如果要更具体的信息,可以加两个问号,对于长篇的编程来看,也是非常方便就可以查看函数的。

如何运用JUPYTER NOTEBOOK的问号

7、oo = {'a': 332, 'b': 32423, 'c':1231}

oo?

Type:        dictString form: {'a': 332, 'b': 32423, 'c': 1231}Length:      3Docstring:  dict() -> new empty dictionarydict(mapping) -> new dictionary initialized from a mapping object's    (key, value) pairsdict(iterable) -> new dictionary initialized as if via:    d = {}    for k, v in iterable:        d[k] = vdict(**kwargs) -> new dictionary initialized with the name=value pairs    in the keyword argument list.  For example:  dict(one=1, two=2)

字典和列表一样,也是可以查看调用的。

如何运用JUPYTER NOTEBOOK的问号

8、pp = (3, 1, 5, 0)

pp?

Type:        tupleString form: (3, 1, 5, 0)Length:      4Docstring:  tuple() -> empty tupletuple(iterable) -> tuple initialized from iterable's itemsIf the argument is a tuple, the return value is the same object.

数组当然和列表和字典是一样可以这么操作查看的。

如何运用JUPYTER NOTEBOOK的问号

  • 怎样用Excel表格制作品质数据频率分布直方图
  • excel表格怎么自动求样本的标准偏差?
  • 利用规划求解在EXCEL中解方程
  • Excel中如何计算阶乘?
  • DataFocus修改数据看板内图表大小以及位置?
  • 热门搜索
    淮安旅游 玉溪旅游 周庄旅游 万达文化旅游城 咸宁旅游 旅游活动 湖南长沙旅游景点 泰国旅游地图 海螺沟旅游攻略 芒市旅游