Is there a one-line way of deleting a key from a dictionary without raising a KeyError
?
if 'key' in my_dict:
del my_dict['key']
Is there a one-line way of deleting a key from a dictionary without raising a KeyError
?
if 'key' in my_dict:
del my_dict['key']