Surprising 2-D List value assignment in IPython console

前端 未结 0 998
走了就别回头了
走了就别回头了 2021-02-01 02:03

Why do I get this output?

noOfNodes = 2
adjMatrix = [[inf]*noOfNodes]*noOfNodes
adjMatrix[0][1] = 1

When I execute the above cod

相关标签:
回答
  • 消灭零回复
提交回复
热议问题