The list comprehension, and its under-utilised sibling the generator expression, are great tools for handling iteration with mapping and filtering in a compact manner. After all, compare: odd_lengthed_squares = [] for n in range(100): square = n * n if ...
Read full entry