Copy List

Joe Riopel goon12 at gmail.com
Wed Jul 18 14:44:26 CEST 2007


On 7/18/07, Robert Rawlins - Think Blue
<robert.rawlins at thinkbluemedia.co.uk> wrote:
> What's the best way to create a copy of a list?

I am pretty new to python but this works:

>>> list_one = [0,1,2,3,4,5,6,7,8,9]
>>> list_two = [i for i in list_one]
>>> print list_two
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>>



More information about the Python-list mailing list