Point 3, if you append a list to itself you get a list that contains a reference to itself as its last element. Exactly as you would expect. Nothing special happens.

It is the print function that puts the ellipsis in, because otherwise it would perform an infinite recursion and crash Python.

This is a clever feature of the print function, not some special behaviour of list objects. Still neat though.

Martin McBride
Martin McBride

Responses (1)