Re: Beginner's question about string's join() method

2008-08-29 Thread Macygasp
On Aug 29, 3:51 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Macygasp wrote: > > Hi, > > > Can anybody tell me why and how this is working: > > >>>> ','.join(str(a) for a in range(0,10)) > > '0,1,2,3,4,5,6,7,8,9&#x

Beginner's question about string's join() method

2008-08-29 Thread Macygasp
Hi, Can anybody tell me why and how this is working: >>> ','.join(str(a) for a in range(0,10)) '0,1,2,3,4,5,6,7,8,9' I find this a little weird because join takes a sequence as argument; so, it means that somehow, from the "str(a) ... " expression, a sequence can be generated. If I write this: