2D lists

Skip Montanaro skip at pobox.com
Tue Jan 21 16:21:13 EST 2003


    >>> b.append(copy.copy(a))

or slightly more efficiently:

    b.append(a[:])

Copy should only be needed (and then copy.deepcopy) if you are creating
higher dimensioned arrays/lists.

Skip





More information about the Python-list mailing list