[Tutor] Standard way to append to a list?
Rick Pasotto
rick@niof.net
Tue Apr 15 07:57:01 2003
On Tue, Apr 15, 2003 at 01:44:38AM -0400, Brian Christopher Robinson wrote:
> Say I have:
>
> list = [1, 2, 3]
>
> What is the standard way to add 4 to the end of the list? I know:
>
> list = list + [4]
>
> would work. What else is there?
That is not appending. What you are doing there is *merging* two lists.
--
"Damn all expurgated books; the dirtiest book of all is the expurgated book."
-- Walt Whitman
Rick Pasotto rick@niof.net http://www.niof.net