Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Dictionary comprehension

>>> {x: x**2 for x in (2, 4, 6)}
{2: 4, 4: 16, 6: 36}
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #Dictionary #comprehension
ADD COMMENT
Topic
Name
7+4 =