<div dir="ltr">Hi Sonny,<br><br>Not if you run kev={} in front of your code. It will keep getting reinitialized to an empty dict.<br><br><br><br><div class="gmail_quote">On Fri, Aug 29, 2008 at 3:42 PM, sunny_plone <span dir="ltr"><<a href="mailto:san82moon@gmail.com">san82moon@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
hi ,<br>
actually my main problem is the the key name or Name should store multiple<br>
values, but now the old value gets replced wen new value is entered. how can<br>
i store old n new values for same key.<br>
<div><div></div><div class="Wj3C7c"><br>
Anand-17 wrote:<br>
><br>
> On Fri, Aug 29, 2008 at 3:27 PM, sunny_plone <<a href="mailto:san82moon@gmail.com">san82moon@gmail.com</a>> wrote:<br>
>><br>
>> hi,<br>
>> sorry for late reply.<br>
>> i want to create a address book which has fields like name, phno, email<br>
>> id<br>
>> etc which are keys.... and i want each key to hav multiple values.... as<br>
>> many users will enter their names. so name key will contain many values.<br>
>> i<br>
>> am not able to store the values entered through command line. i am able<br>
>> to<br>
>> store 1st value, but wen sec value is entered first one is erased.<br>
><br>
> Shouldn't the code be this?<br>
> key[name].append(person_name)<br>
><br>
> Looks like you are always using the same key "Name".<br>
> _______________________________________________<br>
> BangPypers mailing list<br>
> <a href="mailto:BangPypers@python.org">BangPypers@python.org</a><br>
> <a href="http://mail.python.org/mailman/listinfo/bangpypers" target="_blank">http://mail.python.org/mailman/listinfo/bangpypers</a><br>
><br>
><br>
<br>
</div></div><font color="#888888">--<br>
View this message in context: <a href="http://www.nabble.com/help-needed-with-dictionary-tp19215907p19217224.html" target="_blank">http://www.nabble.com/help-needed-with-dictionary-tp19215907p19217224.html</a><br>
</font><div class="Ih2E3d">Sent from the BangPypers - Bangalore Python Users Group mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
</div><div><div></div><div class="Wj3C7c">BangPypers mailing list<br>
<a href="mailto:BangPypers@python.org">BangPypers@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/bangpypers" target="_blank">http://mail.python.org/mailman/listinfo/bangpypers</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>I am but a man.<br>
</div>