List Question

Discussion in 'Python' started by Bill Loren, Jul 27, 2003.

  1. Bill Loren

    Bill Loren Guest

    Hello,

    Forgive my python newbieness.
    Assume I have a list named heck_of_a_list.
    how would I extract the number of elements out of it ?
    (I'm looking for something like perl's $#heck_of_a_list operand)

    thanks
    B
     
    Bill Loren, Jul 27, 2003
    #1
    1. Advertising

  2. "Bill Loren" <> writes:

    > Assume I have a list named heck_of_a_list.
    >
    > how would I extract the number of elements out of it ?


    len(heck_of_a_list)
     
    Matthias Wiehl, Jul 28, 2003
    #2
    1. Advertising

  3. On Mon, 28 Jul 2003 00:23:46 +0200, "Bill Loren"
    <> wrote:

    >Hello,
    >
    >Forgive my python newbieness.
    >Assume I have a list named heck_of_a_list.
    >how would I extract the number of elements out of it ?
    >(I'm looking for something like perl's $#heck_of_a_list operand)
    >
    >thanks
    >B


    Firing the interpreter:

    >>> heck_of_a_list = []
    >>> len(heck_of_a_list)

    0
    >>>



    Maybe you would like to peruse the tutorial that comes with Python.
    It's a very nice intro and it may answer some (a lot?) of your newbie
    questions.

    With my best regards,
    G. Rodrigues
     
    Gonçalo Rodrigues, Jul 28, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. roopa
    Replies:
    6
    Views:
    792
    Jerry Coffin
    Aug 27, 2004
  2. dackz
    Replies:
    0
    Views:
    504
    dackz
    Feb 6, 2007
  3. Debajit Adhikary
    Replies:
    17
    Views:
    720
    Debajit Adhikary
    Oct 18, 2007
  4. OW Ghim Siong
    Replies:
    2
    Views:
    424
    Peter Otten
    Nov 30, 2010
  5. asil klin
    Replies:
    28
    Views:
    1,328
    Andreas Leitgeb
    Mar 5, 2011
Loading...

Share This Page