data = {'x': 1, 'y': 2, 'z': 3} for key in data.keys(): pass data = {'x': 1, 'y': 2, 'z': 3} for key in data: pass Emitted when the keys of a dictionary are iterated through the .keys() method. It is enough to just iterate through the dictionary itself, as in for key in dictionary.