Answers for "python create a dictionary of integers"

1

python create a dictionary of integers

>>> dict([(1, 2), (3, 4)])
{1: 2, 3: 4}
Posted by: Guest on July-06-2020
0

python create a dictionary of integers

>>> dict.fromkeys(range(1, 4))
{1: None, 2: None, 3: None}
>>> dict(zip(range(1, 4), range(1, 4)))
{1: 1, 2: 2, 3: 3}
Posted by: Guest on July-06-2020

Code answers related to "python create a dictionary of integers"

Python Answers by Framework

Browse Popular Code Answers by Language