Delete an element from a dictionary
The del statement removes an element: Note that this mutates the existing dictionary, so the contents of the dictionary changes for anybody else who has a reference to the same instance. To return a new dictionary, make a copy of the dictionary: The dict() constructor makes a shallow copy. To make a deep copy, see the copy module. Note that making a copy for every … Read more