ls = [0 for _ in range(10)] print(ls)
输出为,
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
ls = [False for _ in range(10)] print(ls)
输出为,
[False, False, False, False, False, False, False, False, False, False]
ls = [[0, 0, 0] for _ in range(10)] print(ls)
输出为,
[[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]]