Adding vectors
Python doesn't have a built-in way to do vector (component-wise) addition excepyexcept with libraries. Say a and b are two equal-length lists of numbers you want to add. Instead of the list comprehension
c=[a[i]+b[i]for i in range(len(a))]
you can use
c=map(sum,zip(a,b))
This produces an annoying map object in Python 3 though, but it's shorter even if you have to convert to a list.