Other list comprehension answers are probably the best choice for a simple add, but if you have a more complex function that you need to apply to all elements, then a map might be good.
In your example, this would be:
>>> map(lambda x:x+1, [1,2,3]) [2,3,4]
Andrew Cox Feb 16 2018-12-12T00: 00Z
source share