Is there a one line way of doing the below?
myDict = {} if 'key' in myDic: del myDic['key']
thanks
You can write
myDict.pop(key, None)