Hi Sonny, Not if you run kev={} in front of your code. It will keep getting reinitialized to an empty dict.
On Fri, Aug 29, 2008 at 3:42 PM, sunny_plone <[EMAIL PROTECTED]> wrote: > > 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 <[EMAIL PROTECTED]> > 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@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. > > _______________________________________________ > BangPypers mailing list > BangPypers@python.org > http://mail.python.org/mailman/listinfo/bangpypers > -- I am but a man.
_______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers