items()

The items() method returns tuples of key value pairs.

>>> spam
{'color': 'red', 'age': 42}
>>> for i in spam.items():
...    print(i)
...
('color', 'red')
('age', 42)

You can use the multiple assignment trick in a for loop to assign the key and value to separate variables.

>>> spam
{'color': 'red', 'age': 42}
>>> for k, v in spam.items():
...    print('Key: ' + k + ' Value: ' + str(v))
...
Key: color Value: red
Key: age Value: 42