Newbie help with extend()

Gordon McMillan gmcm at hypernet.com
Mon Mar 20 02:57:23 CET 2000


Steve Holton has problems with list.extend:

> Python 1.5.1 

That's the problem. Didn't appear until 1.5.2.

> Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
> >>> a=[1,2]
> >>> type(a)
> <type 'list'>
> >>> b=[3,4]
> >>> type(b)
> <type 'list'>
> >>> a.extend(b)
> 
> I'm expecting this to set a to [1, 2, 3, 4]

And it will when you upgrade. 



- Gordon




More information about the Python-list mailing list