[BangPypers] help needed with dictionary

sunny_plone san82moon at gmail.com
Fri Aug 29 12:12:27 CEST 2008


hi ,
actually my main problem is the the key name or Name should store multiple
values, but now the old value gets replced wen new value is entered. how can
i store old n new values for same key.

Anand-17 wrote:
> 
> On Fri, Aug 29, 2008 at 3:27 PM, sunny_plone <san82moon at gmail.com> wrote:
>>
>> hi,
>> sorry for late reply.
>> i want to create a address book which has fields like name, phno, email
>> id
>> etc which are keys.... and i want each key to hav multiple values.... as
>> many users will enter their names. so name key will contain many values.
>> i
>> am not able to store the values entered through command line. i am able
>> to
>> store 1st value, but wen sec value is entered first one is erased.
> 
> Shouldn't the code be this?
> key[name].append(person_name)
> 
> Looks like you are always using the same key "Name".
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
> 
> 

-- 
View this message in context: http://www.nabble.com/help-needed-with-dictionary-tp19215907p19217224.html
Sent from the BangPypers - Bangalore Python Users Group mailing list archive at Nabble.com.



More information about the BangPypers mailing list