simple question about Dictionary type containing List objects

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

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


Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932

More information about the Python-list mailing list