[Tutor] Creating a list of lists
Ben Beuchler
insyte@emt-p.org
Mon, 24 Jan 2000 13:12:31 -0600 (Central Standard Time)
On Sun, 23 Jan 2000, Doug Stanfield wrote:
> >>> list1 = [1,2,3]
> >>> list2 = [2,3,4]
> >>> list3 = [3,4,5]
> >>> the_list = []
> >>> the_list.append(list1)
> >>> the_list.append(list2)
> >>> the_list.append(list3)
> >>> the_list
> [[1, 2, 3], [2, 3, 4], [3, 4, 5]]
> >>>
No I feel like a real moron. I was trying to do:
the_list = the_list.append(list3)
which is obviously the wrong idea. I forgot about append changing things in
place...
Thanks for pointing me back in the right direction!
Ben
--
Time is an illusion. Lunchtime doubly so.
--- Ford Prefect