DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
dict comprehensions
>>
>
print
{
i
:
chr
(
65
+
i
)
for
i
in
range
(
4
)
}
{
0
:
'A'
,
1
:
'B'
,
2
:
'C'
,
3
:
'D'
}
Source by www.python.org #
PREVIOUS
NEXT
Tagged:
#dict
#comprehensions
ADD COMMENT
Topic
COMMENT
Name
2+9 =
Submit