simple question about Dictionary type containing List objects

Ulrich Eckhardt eckhardt at satorlaser.com
Mon Jul 13 13:25:29 CEST 2009


gganesh wrote:
> I have a dict object like
> emails={'mycontacts': [ 'xxx at gmail.com, 'yy at gmail.com',
> 'zz at 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




More information about the Python-list mailing list