breaking up a list

Curzio Basso curzio.basso at unibas.ch
Tue Sep 28 10:19:44 EDT 2004


Larry Bates wrote:

>> x=[1,2,3,4,5,6]
>>
> 
> pairs=[[a,b] for a,b in x]
> 

 >>> [[a,b] for a,b in x]
TypeError: unpack non-sequence



More information about the Python-list mailing list