# your code goes here target=3 n=5 dp = [[-1]*(target+2)]*(n+1) print(dp) print(type(dp)) dp = [[-1] * (target+2) for _ in range(n+1)] print(dp) print(type(dp))
Standard input is empty
[[-1, -1, -1, -1, -1], [-1, -1, -1, -1, -1], [-1, -1, -1, -1, -1], [-1, -1, -1, -1, -1], [-1, -1, -1, -1, -1], [-1, -1, -1, -1, -1]] <class 'list'> [[-1, -1, -1, -1, -1], [-1, -1, -1, -1, -1], [-1, -1, -1, -1, -1], [-1, -1, -1, -1, -1], [-1, -1, -1, -1, -1], [-1, -1, -1, -1, -1]] <class 'list'>