When deleting a key from a dictionary, I use:
if \'key\' in my_dict: del my_dict[\'key\']
Is there a one line way of doing this?
Using the "del" keyword:
del dict[key]