Remove a key from a Python dictionary my_dict.pop('key', None) try: del myDict['key'] except KeyError: pass