pop key in hashmap python code example Example 1: python remove key from dict my_dict.pop('key', None) Example 2: python dictionary pop key my_dict.pop('key', None)