List

Charl P. Botha cpbotha at i_triple_e.org
Sun Jun 2 15:27:45 EDT 2002


In article <3cfa6ed8_1 at news.iprimus.com.au>, Gold Fish wrote:
> Assume we got 2 list 
> list 1 = ['ABC','CDG','DAV','FE','FECA','FEAFA','FEA']
> list 2 = []
> how can we copy element from list 1 to list 2 say i just want to copy the 3 
> element 'CDG','DAV','FE' to list2 only.

list1 = ['ABC','CDG','DAV','FE','FECA','FEAFA','FEA']
list2 = list1[1:4]

Is that what you meant?

-- 
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/



More information about the Python-list mailing list