久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

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

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

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

        列表列表,將所有字符串轉換為 int,Python 3

        List of list, converting all strings to int, Python 3(列表列表,將所有字符串轉換為 int,Python 3)

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

            <small id='34r7I'></small><noframes id='34r7I'>

            <tfoot id='34r7I'></tfoot>
            • <bdo id='34r7I'></bdo><ul id='34r7I'></ul>
                <tbody id='34r7I'></tbody>
            • <legend id='34r7I'><style id='34r7I'><dir id='34r7I'><q id='34r7I'></q></dir></style></legend>

                  本文介紹了列表列表,將所有字符串轉換為 int,Python 3的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試將大列表中小列表的所有元素轉換為整數,所以它應該如下所示:

                  I am trying to convert all elements of the small lists in the big list to integers, so it should look like this:

                  current list:
                  list = [['1','2','3'],['8','6','8'],['2','9','3'],['2','5','7'],['5','4','1'],['0','8','7']]
                  
                  
                  for e in list:
                      for i in e:
                          i = int(i)
                  
                  new list:
                  list = [[1,2,3],[8,6,8],[2,9,3],[2,5,7],[5,4,1],[0,8,7]]
                  

                  誰能告訴我為什么這不起作用并向我展示一種有效的方法?謝謝!

                  Could anyone tell me why doesn't this work and show me a method that does work? Thanks!

                  推薦答案

                  你可以使用嵌套列表推導:

                  You can use a nested list comprehension:

                  converted = [[int(num) for num in sub] for sub in lst]
                  

                  我也將list重命名為lst,因為list是列表類型的名稱,不推薦用于變量名.

                  I also renamed list to lst, because list is the name of the list type and not recommended to use for variable names.

                  這篇關于列表列表,將所有字符串轉換為 int,Python 3的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to bind a function to an Action from Qt menubar?(如何將函數綁定到 Qt 菜單欄中的操作?)
                  PyQt progress jumps to 100% after it starts(PyQt 啟動后進度躍升至 100%)
                  How to set yaxis tick label in a fixed position so that when i scroll left or right the yaxis tick label should be visible?(如何將 yaxis 刻度標簽設置在固定位置,以便當我向左或向右滾動時,yaxis 刻度標簽應該可見
                  `QImage` constructor has unknown keyword `data`(`QImage` 構造函數有未知關鍵字 `data`)
                  Change x-axis ticks to custom strings(將 x 軸刻度更改為自定義字符串)
                  How to show progress bar while saving file to excel in python?(如何在python中將文件保存為excel時顯示進度條?)

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

                      <tbody id='hXBjI'></tbody>
                      • <bdo id='hXBjI'></bdo><ul id='hXBjI'></ul>
                        <legend id='hXBjI'><style id='hXBjI'><dir id='hXBjI'><q id='hXBjI'></q></dir></style></legend>

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

                            主站蜘蛛池模板: 国产成人综合久久 | 少妇一级淫片aaaaaaaaa | 成人免费一区二区三区视频网站 | 成人免费在线观看 | 精品粉嫩超白一线天av | 日本精品视频 | 精品久久久一区 | 国内精品视频在线 | 成人中文字幕av | 欧洲亚洲一区二区三区 | 一级片片 | 久久精品国产一区二区电影 | 欧美 日韩 国产 一区 | 日日干综合 | 久久网亚洲 | 国产一区二区三区视频免费观看 | av中文在线| 欧美精品一区二区三区四区五区 | 日韩精品中文字幕一区二区三区 | 中国一级特黄真人毛片免费观看 | 国产成人在线免费 | 免费久 | av免费观看在线 | 伊人伊成久久人综合网站 | 天天精品综合 | 免费黄色日本 | 丝袜 亚洲 欧美 日韩 综合 | 福利视频一区 | 91精品国产91久久久久久吃药 | 中文天堂在线观看 | 九九热九九 | 国产精品一区二区av | 亚洲国产成人在线 | 亚洲国产成人精品女人久久久野战 | 亚洲午夜精品视频 | 久久九九色 | 日韩精品久久久久 | 国产精品特级毛片一区二区三区 | 婷婷久久网 | 亚洲精品福利视频 | 久色视频在线观看 |