dictionary question

Robert Brewer fumanchu at amor.org
Wed Feb 4 17:09:45 EST 2004


José Carlos wrote:
> i have a dictionary. inside this dictionary i have several 
> list and inside
> each list i have data.
> 
> How can i do for add data to these list.
> 
> this is my code:
> 
> conex = {'tipoconex': ['1', '0'], 'conexionS': ['cliente1', 
> 'cliente2'],
> 'clave': ['pepo', 'joan'], 'usuario': ['pepe', 'juan']}

?Solamente quieres poner otro data en una de las listas? Por ejemplo:

conex['clave'].append('gabriel')

sera resultar en:

>>> conex
{'tipoconex': ['1', '0'], 'conexionS': ['cliente1', 'cliente2'],
'clave': ['pepo', 'joan', 'gabriel'], 'usuario': ['pepe', 'juan']}


EQA,

Robert Brewer
MIS
Amor Ministries
fumanchu at amor.org




More information about the Python-list mailing list