You can use the following syntax to delete the element from Dictionary:
del d[key]
The above code mutates the existing dictionary but if you want to return a new dictionary, make a copy of the dictionary using the following code:
def removekey(d, key):
r = dict(d)
del r[key]
return r
If you want to learn handling dictionaries then check out this Python Tutorial by Intellipaat.