Silently removing key from a python dict [duplicate] June 30, 2023 by Tarik You can do this: d.pop("", None) d.pop(None, None) Pops dictionary with a default value that you ignore.