Computer Science, asked by karankumar2089, 1 year ago

How to remove a key from a python dictionary?

Answers

Answered by Anonymous
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}
Similar questions