How to remove a key from a python dictionary?
Answers
Answered by
1
You just have to use 'del' keyword
del dictionary['key goes here']
Example:
d = {"a":1,"b":2}
del d["a"]
print(d)
Output:- {"b":2}
del dictionary['key goes here']
Example:
d = {"a":1,"b":2}
del d["a"]
print(d)
Output:- {"b":2}
Similar questions