In Python the dictionary pop() method is used to remove and return an element from a dictionary having the given key.
Syntax:
There are two Parameters in the dictionary pop() method. key -Which is to be searched for removal and default -The Value which is to be returned when the key is not in the dictionary.
Example:
# dictionary method STUDENT = {'Name': 'Phillip', 'Class': '10'} element = STUDENT.pop('Name') print('Popped element is:', element) print('Given Dictionary is:', STUDENT)