Only for review sake

as an alternative take a look at [itertools module](https://docs.python.org/2/library/itertools.html)