# Python Comprehensions and Built-ins

Short loops and useful functions.

```python
squares = [x * x for x in range(10) if x % 2 == 0]
lookup = {w: len(w) for w in words}
unique = {x for x in items}
gen = (x * 2 for x in nums)       # lazy generator

len(xs); sum(xs); min(xs); max(xs); sorted(xs, key=len)
any(x > 1 for x in xs); all(x > 1 for x in xs)
for i, x in enumerate(xs, start=1): pass
for a, b in zip(xs, ys): pass
list(map(str, xs)); list(filter(None, xs))
range(0, 10, 2)                   # 0, 2, 4, 6, 8
isinstance(x, int); type(x); int("5"); float("1.5"); str(5); bool([])
```
