A question about list

Bruno Desthuilliers onurb at xiludom.gro
Tue Oct 17 12:47:18 EDT 2006


pretoriano_2001 at hotmail.com wrote:
> 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?

b = [item + ['='] for item in a]

-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list