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 = {i : i*i for i in range(1,n+1)} print(ans)
Source by xahlee.info #
PREVIOUS
NEXT
Tagged:
#python
#generate
#dictionary
#loop
ADD COMMENT
Topic
COMMENT
Name
5+9 =
Submit