Why is [[]]*10 the way to create a list of 10 empty lists in python instead of [[]x10]?

后端 未结 0 1751
太阳男子
太阳男子 2020-12-28 12:04

[[]x10] vs [[]] x10

I believe the second makes an empty list of lists with 10 elements, but the first one makes more sense. Care to explain why that may be?

Th

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