Normally, list comprehensions are used to derive a new list from an existing list. Eg:
>>> a = [1, 2, 3, 4, 5] >>> [i for i in a if i >
From python documentation:
List comprehensions provide a concise way to create lists. Common applications are to make new lists
Perhaps you want to learn more about reduce(), filter() and map() functions.