小编Tah*_*ira的帖子

Python:索引列表列表

简单的问题,我有一个列表清单:

x = [['1','2','3'],['4','5','6'],['7','8','9']]
Run Code Online (Sandbox Code Playgroud)

在单个for循环中索​​引每个列表的最简单方法是什么?例如:

for i in x:
    print 1st_list_in_list
    print 2nd_list_in_list
    print 3rd_list_in_list
Run Code Online (Sandbox Code Playgroud)

编辑

让我进一步阐述,我希望打印每个列表是如何的,例如:

for i in x:
    print 1st_list_in_list
    print 2nd_list_in_list
Run Code Online (Sandbox Code Playgroud)

会回来:

1,2,3
4,5,6

python list

4
推荐指数
2
解决办法
2万
查看次数

标签 统计

list ×1

python ×1