How to efficiently proceed addition and subtraction in python list?
Tim Chase
python.list at tim.thechases.com
Mon Sep 18 18:47:52 EDT 2006
More information about the Python-list mailing list
Mon Sep 18 18:47:52 EDT 2006
- Previous message (by thread): How to efficiently proceed addition and subtraction in python list?
- Next message (by thread): How to efficiently proceed addition and subtraction in python list?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> I have a list AAA = [1, 2, 3] and would like to subtract one from list > AAA > so AAA' = [0, 1, 2] > > What should I do? Sounds like a list comprehension to me: >>> a = [1,2,3] >>> a_prime = [x-1 for x in a] >>> a_prime [0, 1, 2] -tkc
- Previous message (by thread): How to efficiently proceed addition and subtraction in python list?
- Next message (by thread): How to efficiently proceed addition and subtraction in python list?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list