n = 4
dp1 = [0] * n
dp2 = [0 for _ in range(n) ]
print('dp1:',dp1)
print('dp2:',dp2)
输出:
dp1: [0, 0, 0, 0]
dp2: [0, 0, 0, 0]
n = 4
dp1 = [0] * n
dp2 = [0 for _ in range(n) ]
print('dp1:',dp1)
print('dp2:',dp2)
输出:
dp1: [0, 0, 0, 0]
dp2: [0, 0, 0, 0]