python dict del key value pair if exists code example Example: python delete dict key if exists mydict.pop("key", None)