On Nov 27, 2006, at 1:55 PM, Kent Johnson wrote: > Keith Troell wrote: >> I'm a rank beginner. I am running Python 2.3.5 on the Terminal of >> Mac OSX. >> The Tutorial (5.1) mentions list.copy as a list method. When I run > > Are you sure? I don't see it here: > http://www.python.org/doc/2.3.5/tut/ > node7.html#SECTION007100000000000000000
Nope, it's not there. Must have had a brain spasm... > >> scores = [1, 2, 3] >> copy = scores.copy () >> I get: AttributeError: 'list' object has no attribute 'copy' > > You can copy a list with the list() function or by slicing: > copy = list(scores) > or > copy = scores[:] > That'll work. Thanks Keith _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor