From: Ramana <ram...@gm...> - 2007-09-07 17:08:34
|
Hi All, Could any one tell me how to delete an element from the dictionary, i have written the following code del locdatalist[delIndex] where locdatalist is my dictionary and delIndex is the index that i want to delete but it doesnt work for me. Could any one help me in resolving this? -- DREAM IT, DO IT |
From: Raghuram D. <dra...@gm...> - 2007-09-07 18:04:23
|
Seems to work for me. lux-rd:lib# jython Jython 2.2 on java1.5.0_09 Type "copyright", "credits" or "license" for more information. >>> s = { 1:2, 3:4} >>> s {3: 4, 1: 2} >>> del s[1] >>> s {3: 4} >>> Same goes for 2.1. Can you post your actual code? Youe terminology is not correct. With dictionaries, there is no "index". There are only "keys". On 9/7/07, Ramana <ram...@gm...> wrote: > Hi All, > > Could any one tell me how to delete an element from the dictionary, i have > written the following code > > del locdatalist[delIndex] > > where locdatalist is my dictionary > and delIndex is the index that i want to delete > > but it doesnt work for me. Could any one help me in resolving this? > > -- > DREAM IT, DO IT > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > > |