iteritems() and enumerate()

Discussion in 'Python' started by Xah Lee, Jan 20, 2005.

  1. Xah Lee

    Xah Lee Guest

    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

    http://xahlee.org/PageTwo_dir/more.html
     
    Xah Lee, Jan 20, 2005
    #1
    1. Advertisements

  2. You would be funnier if you weren't so incompetent.
     
    Erik Max Francis, Jan 20, 2005
    #2
    1. Advertisements

  3. 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>
     
    Fredrik Lundh, Jan 20, 2005
    #3
  4. Xah Lee

    Steve Holden Guest

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

    regards
    Steve
     
    Steve Holden, Jan 20, 2005
    #4
  5. Xah Lee

    alex23 Guest

    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. **** them,
    and **** them for their brainlessness."

    http://xahlee.org/Periodic_dosage_dir/t1/20040403_fem_fatale.html

    With an observational ability like that, who would *ever* listen to a
    word he'd say?
     
    alex23, Jan 21, 2005
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.