list problem

Anthony Tuininga anthony at computronix.com
Tue Sep 24 02:46:49 CEST 2002


If you have list comprehensions available, use

[b for a in x for b in a]

Anthony

On Mon, 2002-09-23 at 17:10, a.clarke11 wrote:
> How about:
> 
> for item in x:
>  while item:
>   y.append(item.pop(0))
> print'y=',y
> ?
> hope this helps
> Tony Clarke
> Glasgow
> 
> jubafre at brturbo.com wrote:
> 
> > i have:
> > x=[['0020', '0000x9'], ['0030', '0000xa'], ['00B4', '0000x8'], ['0030', '0000xb'], ['00F0'], ['0001'], ['0003'], ['0005']]
> >
> > and i want:
> > y=['0020', '0000x9', '0030', '0000xa', '00B4', '0000x8', '0030', '0000xb','00F0', '0001',
> > '0003', '0005']
> >
> > how to do this?
> >
> > Juliano Freitas
> > www.gebrasil.hpg.com.br
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list






More information about the Python-list mailing list