List

Gold Fish occeanlinux at linuxmail.org
Sun Jun 2 15:56:58 EDT 2002


Charl P. Botha wrote:

> 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?
> 
No i mean if i got from list1 i wanna take 3 elements in any position to 
list2 but i don't know how many item in that list.



More information about the Python-list mailing list