Update style.rst

Added a line that was missing from an example (for completeness) and changed an iteration method.

Could use `enumerate(a)` rather than `range(len(a))`, although `enumerate()` is explained only a couple of examples later, hence I opted for `range(len(a))` to show an alternative.