How to delete just one key from a python dictionary? -


i creating dictionary, potentially has keys same, values of each key different. here example dict:

y = {44:0, 55.4:1, 44:2, 5656:3} del y[44] print y {5656: 3, 55.399999999999999: 1} 

i able like:

 del y[44:0] 

or of nature.

you never had duplicate keys:

>>> y = {44:0, 55.4:1, 44:2, 5656:3} >>> y {5656: 3, 55.4: 1, 44: 2} 

a dictionary can initialised duplicate keys, 1 ignored.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -