0

in python let's write

a=[[0]*2]*2
a[0][0] = 55
print(a)

I would expected the following output: [[55, 0], [0,0]]

wihlke
  • 2,455
  • 1
  • 19
  • 18
  • I have edited your code using backticks `\``, to make it more readable :) Can I just check that it's copied correctly? – ACarter Dec 08 '22 at 15:27
  • This question was closed since it has already been answered elsewhere, but a recommendation to new users is that you will get more assistance if you can provide at a minimum; what you want to achieve, what happens instead and what you have tried. – wihlke Dec 08 '22 at 15:53

0 Answers0