如何在Python清单中执行循环

问题描述:

a = [(6,8,9),(8,9,0),(98,65,34)]
#我想要这样的输出:
a [row] [column] = 6,8,9
a [0] [0] = 8,9,0
a [0] [1] = 98,65,34
a [0] [2] = 98,65,34

我尝试过的事情:

为我在:
对于i中的j:
print(a [0] [0])

a=[(6,8,9),(8,9,0),(98,65,34)]
#I want output like this:
a[row][column]=6,8,9
a[0][0]=8,9,0
a[0][1]=98,65,34
a[0][2]=98,65,34

What I have tried:

for i in a:
for j in i:
print(a[0][0])

尝试:
for i in a:
    for j in i:
        print(j)


尝试以下操作:
Try this one:
a=[(6,8,9),(8,9,0),(98,65,34)]
for i in a:
    for j in i:
        print(j , end=" ")
    print()


上面给出了我的输出:


The above gives me the output:

Python 3.6.1 (default, Dec 2015, 13:05:11)
[GCC 4.8.2] on linux

6 8 9
8 9 0
98 65 34


祝你好运;)


Good luck ;)