On Thu, May 26, 2011 at 2:46 PM, Uncle Ben <bgr...@nycap.rr.com> wrote: > In playing with lists of lists, I found the following: > > (In 3.1, but the same happens also in 2.7) > > list = [1,2,3]
Ben Finney has already answered the main question, but as a side point, I would generally avoid creating a variable called 'list'. That's the name of the type (Python 2) or class (Python 3) of all lists, so it might result in confusion if you have an actual list with that name. If you want the behaviour of joining two lists (or adding something to a list) and saving the result elsewhere, you can use the plain addition: a=[1,2,3] b=a+[[4,5,6]] Note that you have to add a list, and it will append the contents of that list. Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list