什么意思?它有意义吗?

Hir*_*nda 3 python

我有时看到并且不理解其含义....三个时期.以下是我不明白的例子:

>>> t = 12345, 54321, 'hello!'
>>> t[0]
12345
>>> t
(12345, 54321, 'hello!')
>>> # Tuples may be nested:
... u = t, (1, 2, 3, 4, 5)
>>> u
((12345, 54321, 'hello!'), (1, 2, 3, 4, 5))
Run Code Online (Sandbox Code Playgroud)

这三个时期的前景是u什么?

Jon*_*nts 5

在您的情况下,主要是为了表明您继续使用相同的代码块.但是,在Python中有一个Ellipsis主要用于numpy数组的对象,但在Python3.x中,它也可以用作...,因此在Python3.x解释器中输入将返回Ellipsis...

作为行/块继续:

>>> if 3 > 2:
...    print 'yes' # indicates we're inside another block or continuing a statement
Run Code Online (Sandbox Code Playgroud)

作为Ellipsis(在Python 3.x中):

Python 3.3.0 (default, Sep 29 2012, 17:14:58) 
[GCC 4.7.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> ...
Ellipsis
Run Code Online (Sandbox Code Playgroud)