I have a dictionary
d = {'a':1, 'b':2, 'c':3}
I need to remove a key, say c and return the dictionary without that key in one function call
{'a':1, 'b':2}
d.pop('c') will return the key value - 3 - instead of the dictionary.
I am going to need one function solution if it exists, as this will go into comprehensions
d.pop('c') return d? - Victor Castillo TorresTruebecause first you remove the value ofcand nowd = {'a':1, 'b':2}and if youreturn dthis one will returns{'a':1, 'b':2}- Victor Castillo Torresd.pop('c')will return d :) Yes, that would work, but I can't use it. I need to use it inside comprehension. - Xeos