469,304 Members | 2,303 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,304 developers. It's quick & easy.

iteritems() and enumerate()

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
4 22643
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
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
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
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.

Similar topics

5 posts views Thread by Pekka Niiranen | last post: by
5 posts views Thread by HL | last post: by
1 post views Thread by smichr | last post: by
6 posts views Thread by Gregory Petrosyan | last post: by
2 posts views Thread by eight02645999 | last post: by
21 posts views Thread by James Stroud | last post: by
2 posts views Thread by rabad | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.