decouple copy of a list

Wolfgang Rohdewald wolfgang at rohdewald.de
Fri Dec 10 08:56:47 EST 2010


On Freitag 10 Dezember 2010, Dirk Nachbar wrote:
> I want to take a copy of a list a
> 
> b=a
> 
> and then do things with b which don't affect a.
> 
> How can I do this?
> 
> Dirk

b=a[:]


-- 
Wolfgang



More information about the Python-list mailing list