Answers for "how to call list in dictionary python in for loop"

1

loop through the dictionary python

>>> objects = ['blue', 'apple', 'dog']
>>> categories = ['color', 'fruit', 'pet']
>>> a_dict = {key: value for key, value in zip(categories, objects)}
>>> a_dict
{'color': 'blue', 'fruit': 'apple', 'pet': 'dog'}
Posted by: Guest on January-29-2021

Code answers related to "how to call list in dictionary python in for loop"

Python Answers by Framework

Browse Popular Code Answers by Language