Re: [Tutor] Replace sequence in list - looking for direction

2008-09-06 Thread Alan Gauld
"peter hodgson" <[EMAIL PROTECTED]> wrote for key in b: keylist = key.split(',') if keylist < a: i = a.index(keylist[0]) print a[:i] + [b[key]] + a[i+len(keylist):] now, i get it, mostly; but keylist being shorter than the list "a" keylist < a True This is not testin

Re: [Tutor] Replace sequence in list - looking for direction

2008-09-06 Thread peter hodgson
greetings, fellow ventriloquists; the exchanges on this list are great tutorials; sometimes i don't quite get the finer points; like here: On Mon, Jun 16, 2008 at 10:41 AM, GTXY20 <[EMAIL PROTECTED]> wrote: > Let's say I have a list like the following: > > a = ['a1','a2','a3','a4','a5','a6'] >

Re: [Tutor] Replace sequence in list - looking for direction

2008-06-16 Thread Tiago Saboga
On Mon, Jun 16, 2008 at 11:41:25AM -0400, GTXY20 wrote: > Hello all, > > Thanks in advance for any thoughts, direction, and guidance. > > Let's say I have a list like the following: > > a = ['a1','a2','a3','a4','a5','a6'] > > and then I have dictionary like the following: > > b = {'a1,a2,a3':'

Re: [Tutor] Replace sequence in list - looking for direction

2008-06-16 Thread W W
On Mon, Jun 16, 2008 at 10:41 AM, GTXY20 <[EMAIL PROTECTED]> wrote: > I need some direction and thoughts on how I might seach the list for the > string (the key in dict b) sequence in list a and replace the occurance with > the value from dict b. At the end I would like to have list a represented >

[Tutor] Replace sequence in list - looking for direction

2008-06-16 Thread GTXY20
Hello all, Thanks in advance for any thoughts, direction, and guidance. Let's say I have a list like the following: a = ['a1','a2','a3','a4','a5','a6'] and then I have dictionary like the following: b = {'a1,a2,a3':'super'} I need some direction and thoughts on how I might seach the list for