simple question about Python list

2008-05-09 Thread dmitrey
hi all, suppose I have 2 lists list1 = ['elem0', 'elem1', 'elem2', 'elem3', 'elem4', 'elem5'] and list2 = [0, 2, 4] # integer elements howto (I mean most simple recipe, of course) form list3 that contains elements from list1 with indexes from list2, i.e. list3 = ['elem0', 'elem2', 'elem4']?

Re: simple question about Python list

2008-05-09 Thread Paul Hankin
On May 9, 11:04 am, dmitrey [EMAIL PROTECTED] wrote: list1 = ['elem0', 'elem1', 'elem2', 'elem3', 'elem4', 'elem5'] and list2 = [0, 2, 4] # integer elements howto (I mean most simple recipe, of course) form list3 that contains elements from list1 with indexes from list2, i.e. list3 =

Re: simple question about Python list

2008-05-09 Thread dmitrey
Ok, I use Python 2.5 but I try my code to remain Python 2.4 and (preferable) 2.3 compatible. Are there other solutions? D. On 9 Тра, 13:17, Paul Hankin [EMAIL PROTECTED] wrote: On May 9, 11:04 am, dmitrey [EMAIL PROTECTED] wrote: list1 = ['elem0', 'elem1', 'elem2', 'elem3', 'elem4', 'elem5']

Re: simple question about Python list

2008-05-09 Thread Russell Blau
On May 9, 6:25 am, dmitrey [EMAIL PROTECTED] wrote: Ok, I use Python 2.5 but I try my code to remain Python 2.4 and (preferable) 2.3 compatible. Are there other solutions? D. On 9 ôÒÁ, 13:17, Paul Hankin [EMAIL PROTECTED] wrote: On May 9, 11:04šam, dmitrey [EMAIL PROTECTED] wrote:

Re: simple question about Python list

2008-05-09 Thread Duncan Booth
dmitrey [EMAIL PROTECTED] wrote: On 9 ôÒÁ, 13:17, Paul Hankin [EMAIL PROTECTED] wrote: On May 9, 11:04šam, dmitrey [EMAIL PROTECTED] wrote: list1 = ['elem0', 'elem1', 'elem2', 'elem3', 'elem4', 'elem5'] and list2 = [0, 2, 4] # integer elements howto (I mean most simple recipe, of

Re: simple question about Python list

2008-05-09 Thread dmitrey
Hmm... I thought this issue is available from Python2.5 only. I have no other interpreters in my recently installed KUBUNTU 8.04. Thanks all, D. On 9 Тра, 13:41, Duncan Booth [EMAIL PROTECTED] wrote: dmitrey [EMAIL PROTECTED] wrote: On 9 ôÒÁ, 13:17, Paul Hankin [EMAIL PROTECTED] wrote: On

Re: simple question about Python list

2008-05-09 Thread Bjoern Schliessmann
dmitrey wrote: Hmm... I thought this issue is available from Python2.5 only. I have no other interpreters in my recently installed KUBUNTU 8.04. aptitude install python2.4 helps. Regards, Björn -- BOFH excuse #10: hardware stress fractures --

Re: simple question about Python list

2008-05-09 Thread Arnaud Delobelle
dmitrey wrote: Ok, I use Python 2.5 but I try my code to remain Python 2.4 and (preferable) 2.3 compatible. Are there other solutions? D. On 9 ���, 13:17, Paul Hankin [EMAIL PROTECTED] wrote: On May 9, 11:04�am, dmitrey [EMAIL PROTECTED] wrote: list1 = ['elem0', 'elem1', 'elem2',