DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
python generate dictionary in loop
n
=
int
(
input
(
)
)
ans
=
{
}
for
i
in
range
(
1
,
n
+
1
)
:
ans
[
i
]
=
i
*
i
print
(
ans
)
Source by xahlee.info #
PREVIOUS
NEXT
Tagged:
#python
#generate
#dictionary
#loop
ADD COMMENT
Topic
COMMENT
Name
1+7 =
Submit