DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
4+7 =
Submit