[Lesson 11] change range to xrange and empty to zeros.

When looping, range() has been replaced by xrange(), suppose to be faster.
When creating an array where we are using += or -= to fill it,
use np.zeros instead of np.empty.