Help about dictionary append

Anatoli Hristov tolidtm at gmail.com
Sun Feb 5 10:13:39 EST 2012


Hi there,

I`m again confused and its the dictionary. As dictionary does not support
append I create a variable list with dictionary key values and want to add
new values to it and then copy it again to the dictionary as I dont know
other methods.

mydict =
{'Name':('Name1','Name2','Name3'),'Tel':('023333','037777','049999')}

Then I use the key "Name" from the dict

name = mydict['Name']
and
tel = mydict['Tel']

then I want to add at the end new values and doing:

name.append('Name4')

and I get and error that TUPLE object has no attribute Append !!!

But how to add new Values to a dictionary then ?

I know its kind of basics in python, but I was seeking in the python
website and even google and could not realise that.

Thank you for your suggestions

A.H
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120205/8c918fe5/attachment.html>


More information about the Python-list mailing list