>>> d = {'foo': 1, 'bar': 2, 'baz': 3} >>> for k, v in d.items(): ... print('k =', k, ', v =', v) ... k = foo , v = 1 k = bar , v = 2 k = baz , v = 3