A question about list

rzed rzantow at gmail.com
Tue Oct 17 13:49:20 EDT 2006


pretoriano_2001 at hotmail.com wrote in news:1161102973.920895.141500
@i42g2000cwa.googlegroups.com:

> Hello:
> Variable 'a' has the next values:
> [[1,1],[2,2]]
> and I want to take a to b as:
> [[1,1,'='],[2,2,'=']]
> How can I do this with only one line of instruction?
> Thanks!!
> 

b = [[x,y,'='] for (x,y) in a]

-- 
rzed



More information about the Python-list mailing list