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
Post a Comment