列表列表,我想更改一个组件

时间:2019-08-23 14:11:09

标签: python list

在19x19矩阵中,现在所有ListView.builder( physics:AlwaysScrollableScrollPhysics(), itemCount: 1, itemBuilder: (context, index) { return Text('No data\nPull to Refresh'); }, ) (列表a的列表)

例如,我想将components == 0更改为a[1][1]

但他们更改了列表(a)列表的所有索引(1)

强调文本试图停止使用for语句,而改为while-,只是多次键入而不使用循环。

1

1 个答案:

答案 0 :(得分:3)

您要一次又一次地添加同一行。

a = []

row = []

for i in range(19) :
    row.append(0)

for i in range(19) :
    a.append(row[:])    #slice it to make a copy