.pop() method of a Python dictionary returns the value of a specified key, then removes the key-value pair from the dictionary.
key is the key of the value to return and the entry to remove.
The following example creates a dictionary and “pops” a value from it:
Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.
Learn Python on Codecademy
Computer ScienceLooking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
Includes 6 Courses
With Professional Certification