You can change this to `for index, section in enumerate(sections):` and get rid of manually doing your own counter. Also please use var name such as `index` or `idx` instead of `i`.

https://docs.python.org/2/library/functions.html#enumerate