


PYTHON INTERMEDIATE
Dictionary comprehensions
A dictionary comprehension builds dictionaries using key-value expressions: `{key_expr: value_expr for item in iterable}`.
How it reads
{n: len(n) ...} maps name to its length as key and value
for n in names defines the source iterable loop

Cloud tip: Like list comprehensions, you can add conditional if checks at the end of a dict comprehension.
