On Tue, 27 Oct 2009 15:16:15 -0700, Gary Herron wrote: > Try this: > > > >>> d = [1,2,3] > >>> r = [[x for x in d] for i in range(3)] > >>> r[1][2] = 999 > >>> r > [[1, 2, 3], [1, 2, 999], [1, 2, 3]]
[x for x in d] is better written as d[:] -- Steven -- http://mail.python.org/mailman/listinfo/python-list