May-30-2020, 10:26 AM
A dictionary has a pop method:
https://docs.python.org/3/library/stdtyp...p#dict.pop Wrote:pop(key[, default])
If key is in the dictionary, remove it and return its value, else return default. If default is not given and key is not in the dictionary, a KeyError is raised.