Am 11.04.2013 11:48, schrieb inshu chauhan: > I have a prog in which a functions returns a dict but when I try to > iterate over the dict using iterkeys, It shows an error.
1) Show us your code in form of a minimal "working" example, "working" means that it should show us what you expect it to do but at the same time shows the behaviour you complain about. 2) Show us your actual error message! > I think its > because only address of the dictionary is returned so cannot be iterated > upon. Python does not use addresses, it uses references. And as long as you have a valid reference to a dict assigned to some name in some namespace you should be able to iterate over its keys using some_dict.iterkeys(). -- http://mail.python.org/mailman/listinfo/python-list