Iterate over dictionary in Python

>>> x
{'abc': 'five thousand', 9: 'foo', 'bar': 'baz'}
>>> x.keys()
dict keys(['abc', 9, 'bar'])
>>> for key in x.keys():
       print("Key", key, "has a value of", x[key])
Key abc, has a value of five thousand
Key 9 has a value of foo
Key bar has a value of baz
>>>
>>> for val in x.values():
      print(val)
five thousand
foo
baz
>>>
>>> for item in x.items():
      print(item)
      print("key", item[0], "value", item[1])
('abc', five thousand')
key abc value five thousand
(9, 'foo')
key 9 value foo
('bar', 'baz')
key bar value baz