delete a key value pair from a dictionary in python

mydict = {'score1': 41, 'score2': 23, 'score3': 45}

del mydict['score2']
print(mydict)
{'score1': 41, 'score3': 45}

Here is what the above code is Doing:
1. We create a dictionary with three key-value pairs.
2. We delete the key-value pair with key ‘score2’.
3. We print the dictionary.

As you can see, the key-value pair with key ‘score2’ is no longer in the dictionary.