simple question about Dictionary type containing List objects

Discussion in 'Python' started by gganesh, Jul 13, 2009.

  1. gganesh

    gganesh Guest

    Hi group,
    I have a dict object like
    emails={'mycontacts': [ ', '',
    ''], 'myname':['gganesh']}
    I need to get the lenght of the list mycontacts ,like
    mycontacts_numbers=3
    help me to solve
    Thanks
     
    gganesh, Jul 13, 2009
    #1
    1. Advertising

  2. gganesh wrote:
    > I have a dict object like
    > emails={'mycontacts': [ ', '',
    > ''], 'myname':['gganesh']}
    > I need to get the lenght of the list mycontacts ,like
    > mycontacts_numbers=3


    mycontacts = emails['mycontacts']
    mycontacts_number = len(mycontacts)

    A list doesn't change in behaviour when it is contained in a dictionary.

    Uli

    --
    Sator Laser GmbH
    Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932
     
    Ulrich Eckhardt, Jul 13, 2009
    #2
    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. Rob Meade
    Replies:
    4
    Views:
    30,412
    rahul891
    Nov 4, 2012
  2. Ben

    dictionary containing a list

    Ben, Oct 6, 2006, in forum: Python
    Replies:
    10
    Views:
    478
    Hendrik van Rooyen
    Oct 9, 2006
  3. Poppy
    Replies:
    1
    Views:
    396
    Poppy
    May 30, 2008
  4. cocolombo

    Object containing a list of objects.

    cocolombo, Aug 28, 2010, in forum: Python
    Replies:
    5
    Views:
    278
    cocolombo
    Aug 28, 2010
  5. Steve

    Objects containing objects

    Steve, Jan 13, 2008, in forum: Perl Misc
    Replies:
    2
    Views:
    80
    Paul Lalli
    Jan 13, 2008
Loading...

Share This Page