Among a lot of interesting stuff in python the concept of Generators took me by surprise, so I will give an try to share the excitement with the rest of you out there who haven’t used it yet. Before I delve into this nice concept, I welcome you to the world of exotic flow control, truly Python has a charm of its own.
Imagine we have a set of numbers representing the fibonacci series in a list and then we traverse the list to get the numbers.

The data in the list is pre-generated using a formula, or manually entered by the user. This list can be really big, and then we have memory considerations. In cases where we really do not know how many of this elements we need to use, but still we have to pre-generate all of it just in case we need it. In such a scenario Pythons Generator comes to the rescue. Read the rest of this entry »






