<tfoot id='TonKR'></tfoot>
<legend id='TonKR'><style id='TonKR'><dir id='TonKR'><q id='TonKR'></q></dir></style></legend>
    <bdo id='TonKR'></bdo><ul id='TonKR'></ul>
  • <i id='TonKR'><tr id='TonKR'><dt id='TonKR'><q id='TonKR'><span id='TonKR'><b id='TonKR'><form id='TonKR'><ins id='TonKR'></ins><ul id='TonKR'></ul><sub id='TonKR'></sub></form><legend id='TonKR'></legend><bdo id='TonKR'><pre id='TonKR'><center id='TonKR'></center></pre></bdo></b><th id='TonKR'></th></span></q></dt></tr></i><div id='TonKR'><tfoot id='TonKR'></tfoot><dl id='TonKR'><fieldset id='TonKR'></fieldset></dl></div>

    <small id='TonKR'></small><noframes id='TonKR'>

        省略号 [...] 在列表中是什么意思?

        What do ellipsis [...] mean in a list?(省略号 [...] 在列表中是什么意思?)

        <i id='sP3y1'><tr id='sP3y1'><dt id='sP3y1'><q id='sP3y1'><span id='sP3y1'><b id='sP3y1'><form id='sP3y1'><ins id='sP3y1'></ins><ul id='sP3y1'></ul><sub id='sP3y1'></sub></form><legend id='sP3y1'></legend><bdo id='sP3y1'><pre id='sP3y1'><center id='sP3y1'></center></pre></bdo></b><th id='sP3y1'></th></span></q></dt></tr></i><div id='sP3y1'><tfoot id='sP3y1'></tfoot><dl id='sP3y1'><fieldset id='sP3y1'></fieldset></dl></div>
          <tfoot id='sP3y1'></tfoot>
            <bdo id='sP3y1'></bdo><ul id='sP3y1'></ul>

              <tbody id='sP3y1'></tbody>

            <legend id='sP3y1'><style id='sP3y1'><dir id='sP3y1'><q id='sP3y1'></q></dir></style></legend>
          • <small id='sP3y1'></small><noframes id='sP3y1'>

                1. 本文介绍了省略号 [...] 在列表中是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  I was playing around in python. I used the following code in IDLE:

                  p  = [1, 2]
                  p[1:1] = [p]
                  print p
                  

                  The output was:

                  [1, [...], 2]
                  

                  What is this […]? Interestingly I could now use this as a list of list of list up to infinity i.e.

                  p[1][1][1]....
                  

                  I could write the above as long as I wanted and it would still work.

                  EDIT:

                  • How is it represented in memory?
                  • What's its use? Examples of some cases where it is useful would be helpful.
                  • Any link to official documentation would be really useful.

                  解决方案

                  It means that you created an infinite list nested inside itself, which can not be printed. p contains p which contains p ... and so on. The [...] notation is a way to let you know this, and to inform that it can't be represented! Take a look at @6502's answer to see a nice picture showing what's happening.

                  Now, regarding the three new items after your edit:

                  • This answer seems to cover it
                  • Ignacio's link describes some possible uses
                  • This is more a topic of data structure design than programming languages, so it's unlikely that any reference is found in Python's official documentation

                  这篇关于省略号 [...] 在列表中是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Split a Pandas column of lists into multiple columns(将 Pandas 的列表列拆分为多列)
                  How does the @property decorator work in Python?(@property 装饰器在 Python 中是如何工作的?)
                  What is the difference between old style and new style classes in Python?(Python中的旧样式类和新样式类有什么区别?)
                  How to break out of multiple loops?(如何打破多个循环?)
                  How to put the legend out of the plot(如何将传说从情节中剔除)
                  Why is the output of my function printing out quot;Nonequot;?(为什么我的函数输出打印出“无?)
                  • <i id='cGjVm'><tr id='cGjVm'><dt id='cGjVm'><q id='cGjVm'><span id='cGjVm'><b id='cGjVm'><form id='cGjVm'><ins id='cGjVm'></ins><ul id='cGjVm'></ul><sub id='cGjVm'></sub></form><legend id='cGjVm'></legend><bdo id='cGjVm'><pre id='cGjVm'><center id='cGjVm'></center></pre></bdo></b><th id='cGjVm'></th></span></q></dt></tr></i><div id='cGjVm'><tfoot id='cGjVm'></tfoot><dl id='cGjVm'><fieldset id='cGjVm'></fieldset></dl></div>

                      <small id='cGjVm'></small><noframes id='cGjVm'>

                        • <bdo id='cGjVm'></bdo><ul id='cGjVm'></ul>
                            <tbody id='cGjVm'></tbody>

                        • <legend id='cGjVm'><style id='cGjVm'><dir id='cGjVm'><q id='cGjVm'></q></dir></style></legend>
                          <tfoot id='cGjVm'></tfoot>