Answers for "can you a loop to access the contents of a dictionary python"

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 "can you a loop to access the contents of a dictionary python"

Python Answers by Framework

Browse Popular Code Answers by Language