Source Code:
(back to article)
my_dict = {'key1': 'value1', 'key2': 'value2', 'key3': 'value3'} new_dict = {key: value for key, value in my_dict.items() if key != 'key2'} print(new_dict)
Result:
Report an issue