how to iterate through all keys in dictionary python code example
Example: python iterate dictionary key value
a_dict = {'color': 'blue', 'fruit': 'apple', 'pet': 'dog'}
for key, value in a_dict.items():
print(key, '->', value)
a_dict = {'color': 'blue', 'fruit': 'apple', 'pet': 'dog'}
for key, value in a_dict.items():
print(key, '->', value)