Subtract a value from every number in a list in Python?
With a list comprehension:
a = [x - 13 for x in a]
If are you working with numbers a lot, you might want to take a look at NumPy. It lets you perform all kinds of operation directly on numerical arrays. For example:
>>> import numpy
>>> array = numpy.array([49, 51, 53, 56])
>>> array - 13
array([36, 38, 40, 43])
You can use map() function:
a = list(map(lambda x: x - 13, a))