Re: [Tutor] Using 'join ' function to create a string

2007-12-21 Thread christopher . henk
this works for me. Z=", ".join(["%s:%s" %(a,Y[b]) for b,a in enumerate(X)]) lechtlr <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 12/21/2007 11:00 AM To tutor@python.org cc Subject [Tutor] Using 'join ' function to create a string Hi there, I

Re: [Tutor] Using 'join ' function to create a string

2007-12-21 Thread bob gailer
lechtlr wrote: > Hi there, > > I would like to know what is the best way to create a string object > from two different lists using 'join' function. For example, I have X > = ['a', 'b', 'c', 'd', 'e'] and Y = [1, 2, 3, 4, 5]. From X and Y, I > want to create a string Z = 'a:1, b:2, c:3, d:4, e:5

Re: [Tutor] Using 'join ' function to create a string

2007-12-21 Thread Dave Kuhlman
On Fri, Dec 21, 2007 at 09:33:31AM -0700, Eric Brunson wrote: > lechtlr wrote: > > Hi there, > > > > I would like to know what is the best way to create a string object > > from two different lists using 'join' function. For example, I have X > > = ['a', 'b', 'c', 'd', 'e'] and Y = [1, 2, 3, 4, 5

Re: [Tutor] Using 'join ' function to create a string

2007-12-21 Thread Eric Brunson
lechtlr wrote: > Hi there, > > I would like to know what is the best way to create a string object > from two different lists using 'join' function. For example, I have X > = ['a', 'b', 'c', 'd', 'e'] and Y = [1, 2, 3, 4, 5]. From X and Y, I > want to create a string Z = 'a:1, b:2, c:3, d:4, e:5

[Tutor] Using 'join ' function to create a string

2007-12-21 Thread lechtlr
Hi there, I would like to know what is the best way to create a string object from two different lists using 'join' function. For example, I have X = ['a', 'b', 'c', 'd', 'e'] and Y = [1, 2, 3, 4, 5]. From X and Y, I want to create a string Z = 'a:1, b:2, c:3, d:4, e:5'. Any help would greatly