0

I’m reading the book “Practical Programming: An Introduction to Computer Science Using Python 3”. In Chapter 8 (Lists), there is a question in the book as follows:

  • Draw a memory model showing the effect of the following statements

    values = [0,1,2]
    values[1] = values
    

Why does print values show [0, [...], 2]? Shouldn't it be [0, [0,1,2], 2]?

rninty
  • 1,072
  • 6
  • 10
hvu89
  • 69
  • 1
  • 3
  • 9

0 Answers0