0
child= [[]] * 10
child[0].append(3)

I expected the output to be

child
[[3], [], [], [], [], [], [], [], [], []]

where output came out to be

child
[[3], [3], [3], [3], [3], [3], [3], [3], [3], [3]]
Zero Piraeus
  • 56,143
  • 27
  • 150
  • 160
dev2qa
  • 26
  • 4

0 Answers0