如題!!!!!!!!!!!!!
uj5u.com熱心網友回復:
[[None, None, None, None, None], [None, None, None, None, None], [None, None, None, None, None], [None, None, None, None, None], [None, None, None, None, None]]如果n=5,就是一個5*5內容為none的串列
uj5u.com熱心網友回復:
這個代碼意思就相當于:board=[]
for i in range(n):
list_1=[]
for j in range(n):
list_1.append(None)
board.append(list_1)
只不過這樣可以簡化代碼
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/83979.html
上一篇:IndexError: list index out of range錯誤
下一篇:TypeError: getsockaddrarg: AF_INET address must be tuple, not str Python發郵件提示錯誤
