Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to create data dictionary in python using keys and values

keys_list = ["a", "b"]
values_list = [1, 2]
zip_iterator = zip(keys_list, values_list) Get pairs of elements.
a_dictionary = dict(zip_iterator) Convert to dictionary.
print(a_dictionary)
 
PREVIOUS NEXT
Tagged: #create #data #dictionary #python #keys #values
ADD COMMENT
Topic
Name
9+7 =