pop key only if it exists python code example Example: delete key from python dictionary dictionary.pop(key)