The popitem() method removes and returns the last item in the dictionary.
The syntax is as shown below:
d.popitem()
The method does not take any argument. It returns a two-length tuple in the form of (key, value) of the removed item.
If the dictionary is empty, a KeyError exception will be raised.