By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,996 Members | 1,498 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,996 IT Pros & Developers. It's quick & easy.

iteritems() and enumerate()

P: n/a
Python has iteritems() and enumerate() to be used in for loops.

can anyone tell me what these are by themselves, if anything?

are they just for idiom?
thanks.

Xah
xa*@xahlee.org
http://xahlee.org/PageTwo_dir/more.html

Jul 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Xah Lee wrote:
Python has iteritems() and enumerate() to be used in for loops.

can anyone tell me what these are by themselves, if anything?

are they just for idiom?
thanks.


You would be funnier if you weren't so incompetent.

--
Erik Max Francis && ma*@alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
Democritus may have come from Abdera, but he was no dummy.
-- Carl Sagan
Jul 18 '05 #2

P: n/a
Xah Lee wrote:
Python has iteritems() and enumerate() to be used in for loops.

can anyone tell me what these are by themselves, if anything?


iteritems() is a dictionary method, which returns a lazily constructed
sequence of all (key, value) pairs in the dictionary.

enumerate(seq) is a function that returns a lazily constructed list of
(index, value) pairs for all values in a sequence.

check the relevant sections of the library reference for details.

</F>

Jul 18 '05 #3

P: n/a
Xah Lee wrote:
Python has iteritems() and enumerate() to be used in for loops.

can anyone tell me what these are by themselves, if anything?

are they just for idiom?


No, anyone can use them, not just idioms like you.

regards
Steve
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/
Holden Web LLC +1 703 861 4237 +1 800 494 3119
Jul 18 '05 #4

P: n/a
Erik Max Francis wrote:
You would be funnier if you weren't so incompetent.


No, even if he was more competent, he'd still be a vicious, pointless
asshole:

"By the way, the pussy sex accuse us and hate us virile sex for
undiscrimination and hunger for humping. But look at their ugliness,
hogging with their arms and legs the moment a powerful dick or asshole
walks by. If we males are assholes, they made us so. If male animals
rape female animals, the females has a lot to do with it. Fuck them,
and fuck them for their brainlessness."

http://xahlee.org/Periodic_dosage_di...em_fatale.html

With an observational ability like that, who would *ever* listen to a
word he'd say?

Jul 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.