Result Size:
625 x 571
demo_ref_dictionary_fromkeys.py:
x = ('key1', 'key2', 'key3') y = 0 thisdict = dict.fromkeys(x, y) print(thisdict)
x
x
=
(
'key1'
,
'key2'
,
'key3'
)
y
=
0
thisdict
=
dict
.
fromkeys
(
x
,
y
)
print
(
thisdict
)
C:\Users\My Name>python demo_dictionary_fromkeys.py
['key1': 0, 'key2': 0, 'key3': 0]