<bdo id='eKBg2'></bdo><ul id='eKBg2'></ul>

  • <tfoot id='eKBg2'></tfoot>

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

    1. <legend id='eKBg2'><style id='eKBg2'><dir id='eKBg2'><q id='eKBg2'></q></dir></style></legend>

        <i id='eKBg2'><tr id='eKBg2'><dt id='eKBg2'><q id='eKBg2'><span id='eKBg2'><b id='eKBg2'><form id='eKBg2'><ins id='eKBg2'></ins><ul id='eKBg2'></ul><sub id='eKBg2'></sub></form><legend id='eKBg2'></legend><bdo id='eKBg2'><pre id='eKBg2'><center id='eKBg2'></center></pre></bdo></b><th id='eKBg2'></th></span></q></dt></tr></i><div id='eKBg2'><tfoot id='eKBg2'></tfoot><dl id='eKBg2'><fieldset id='eKBg2'></fieldset></dl></div>
      1. Python:将列表列表初始化为一定大小,

        Python: Initialize a list of lists to a certain size,(Python:将列表列表初始化为一定大小,)
          <tfoot id='taHQn'></tfoot>
            <bdo id='taHQn'></bdo><ul id='taHQn'></ul>
          • <i id='taHQn'><tr id='taHQn'><dt id='taHQn'><q id='taHQn'><span id='taHQn'><b id='taHQn'><form id='taHQn'><ins id='taHQn'></ins><ul id='taHQn'></ul><sub id='taHQn'></sub></form><legend id='taHQn'></legend><bdo id='taHQn'><pre id='taHQn'><center id='taHQn'></center></pre></bdo></b><th id='taHQn'></th></span></q></dt></tr></i><div id='taHQn'><tfoot id='taHQn'></tfoot><dl id='taHQn'><fieldset id='taHQn'></fieldset></dl></div>

              <legend id='taHQn'><style id='taHQn'><dir id='taHQn'><q id='taHQn'></q></dir></style></legend>
                  <tbody id='taHQn'></tbody>

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

                • 本文介绍了Python:将列表列表初始化为一定大小,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试初始化big_list",这是一个包含列表的列表,我们提前知道big_list"中将有 200 个列表,并且每个列表将只包含字符串或不包含任何内容,稍后在程序中将有一个循环,将(一次或多次)附加到这些列表中的特定数量.

                  I'm trying to initialize 'big_list', which is a list containing lists, and we know in advance that there will be 200 lists within 'big_list', and that each list will contain only strings or nothing, and that later in the program there will be a loop that appends(one or more times) to only a certain number of those lists.

                  有没有最简单的方法来解决这个问题?

                  Is there a simplest way to go about this?

                  推荐答案

                  你可以使用列表推导例如:

                  You can use list comprehension for example:

                  big_list = [[] for _ in range(200)]
                  

                  这将创建一个包含 200 个不同列表的列表.

                  That will create a list containing 200 different lists.

                  这篇关于Python:将列表列表初始化为一定大小,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Adding config modes to Plotly.Py offline - modebar(将配置模式添加到 Plotly.Py 离线 - 模式栏)
                  Plotly: How to style a plotly figure so that it doesn#39;t display gaps for missing dates?(Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙?)
                  python save plotly plot to local file and insert into html(python将绘图保存到本地文件并插入到html中)
                  Plotly: What color cycle does plotly express follow?(情节:情节表达遵循什么颜色循环?)
                  How to save plotly express plot into a html or static image file?(如何将情节表达图保存到 html 或静态图像文件中?)
                  Plotly: How to make a line plot from a pandas dataframe with a long or wide format?(Plotly:如何使用长格式或宽格式的 pandas 数据框制作线图?)
                    <bdo id='GfaT5'></bdo><ul id='GfaT5'></ul>

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

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

                              <tbody id='GfaT5'></tbody>