从Python dict中删除多个键

ozg*_*gur 5 python dictionary

有没有一种有效的快捷方法可以从python字典中一次删除多个键?

例如;

x = {'a': 5, 'b': 2, 'c': 3}
x.pop('a', 'b')
print x
{'c': 3}
Run Code Online (Sandbox Code Playgroud)

var*_*tec 13

使用del语句:

x = {'a': 5, 'b': 2, 'c': 3}
del x['a'], x['b']
print x
{'c': 3}
Run Code Online (Sandbox Code Playgroud)