Python-有趣的二維數組

有趣的二維數組,對於初學python的人的確有必定的迷惑性(就是我。。) 看代碼:html a=[] b=[] for i in range(5): a.append(b) a[0]=1 a[1].append(2) a[2].append(3) print(a) out:python [1, [2, 3], [2, 3], [2, 3], [2, 3]] 代碼建立一個二位數組,但當咱們
相關文章
相關標籤/搜索