dictionary: dict Comprehension

>>> {x: x**2 for x in (2, 4, 6)}
{2: 4, 4: 16, 6: 36}

Used to create dictionaries from arbitrary key and value expressions.

dictionary: dict Comprehension — Structure map

Clickable & Draggable!

dictionary: dict Comprehension — Related pages: