dict.pop
allows you to remove and return an item with the matching key from a dictionary. If a key doesn’t exist, you will get a KeyError
.
To avoid this error, add a default value to the second argument of dict.pop
.
dict.pop
allows you to remove and return an item with the matching key from a dictionary. If a key doesn’t exist, you will get a KeyError
.
To avoid this error, add a default value to the second argument of dict.pop
.