Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

simple question about Dictionary type containing List objects

0 views
Skip to first unread message

gganesh

unread,
Jul 13, 2009, 6:34:19 AM7/13/09
to
Hi group,
I have a dict object like
emails={'mycontacts': [ 'x...@gmail.com, 'y...@gmail.com',
'z...@gmail.com'], 'myname':['gganesh']}
I need to get the lenght of the list mycontacts ,like
mycontacts_numbers=3
help me to solve
Thanks


Ulrich Eckhardt

unread,
Jul 13, 2009, 7:25:29 AM7/13/09
to
gganesh wrote:
> I have a dict object like
> emails={'mycontacts': [ 'x...@gmail.com, 'y...@gmail.com',
> 'z...@gmail.com'], '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

0 new messages