List generators aka list comprehensions and list displays provide a quick way to create a list with selected elements from any enumerable object.
List generators are defined through the following syntaxes:
Some examples will help ilustrate the concept:
List with all the doubles from 0 to 5 (exclusive)
List with the names of the customers based on Rio de Janeiro