Re: [Tutor] Unzipping a list

2008-08-01 Thread Monika Jisswel
> > >>> answers= ['ask','tell','repeat','sell'] > >>> > >>> > >>> a = '/usr/program/bin -o '+ ' '.join(answers) > >>> print a > /usr/program/bin -o ask tell repeat sell > 2008/7/8 Faheem <[EMAIL PROTECTED]>: > Hey all, > > If anyone is interested I found this while googling > > answers= ['ask'.'t

Re: [Tutor] Unzipping a list

2008-07-08 Thread Alan Gauld
"Faheem" <[EMAIL PROTECTED]> wrote If anyone is interested I found this while googling answers= ['ask'.'tell','repeat','sell'] def unzip(answers): unzipped = "".join(answers) # if all items are strings unzipped = ", ".join(map(str, answers)) unzipped = " ".join(str(v) for v in answers i

Re: [Tutor] Unzipping a list

2008-07-08 Thread Faheem
Hey all, If anyone is interested I found this while googling answers= ['ask'.'tell','repeat','sell'] def unzip(answers): unzipped = "".join(answers) # if all items are strings unzipped = ", ".join(map(str, answers)) unzipped = " ".join(str(v) for v in answers if v > 0) return unzipped

[Tutor] Unzipping a list

2008-07-07 Thread Faheem
hey all, How can i pass the elements of a list in the follwoing manner? L =['ask'.'tell','repeat','sell'] To illustrate my question: how can i pass the above list as follows "/some/program/run -o ask tell repeat sell" thanks in advance ___ Tut