Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #43342

Can I iterate over a dictionary outside a function ?

Date 2013-04-11 15:18 +0530
Subject Can I iterate over a dictionary outside a function ?
From inshu chauhan <insideshoes@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.452.1365673689.3114.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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. I think its because only
address of the dictionary is returned so cannot be iterated upon.

Please suggest some way by which it can be made possible to iterate over
the dictionary using  iterkeys outside the function ?

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Can I iterate over a dictionary outside a function ? inshu chauhan <insideshoes@gmail.com> - 2013-04-11 15:18 +0530
  Re: Can I iterate over a dictionary outside a function ? Alexander Blinne <news@blinne.net> - 2013-04-11 23:33 +0200

csiph-web