a.pop(k[, x]) a[k] if k in a, else x (and remove k).
a.pop(k[, x])
a[k]
k in a
dict.pop raises a KeyError when no default value is given and the key is not found. New in version 2.3.