📜  网格列表 python 代码示例

📅  最后修改于: 2022-03-11 14:45:47.198000             🧑  作者: Mango

代码示例2
width = int(input("How wide?"))
height = int(input("How high?"))
grid = []
row = []
bak = "."
for i in range(width):
    row.append(bak)
for i in range(height):
    grid.append(row)
while True:
    for i in range(len(grid)):
        print(grid[i])