Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to assign key and value to hash dictionary in python

dictionary = {}
 
keys = ['key2', 'key1', 'key3']
values = ['geeks', 'for', 'geeks']
 
for key, value in zip(keys, values):
    dictionary[key] = value
print(dictionary)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #assign #key #hash #dictionary #python
ADD COMMENT
Topic
Name
9+6 =