Question: Is there any efficient shortcut method to delete more than one key at a time from a python dictionary?

For instance;

```
x = {'a': 5, 'b': 2, 'c': 3}
x.pop('a', 'b')
print x
{'c': 3}

```

Answer: 
Use [the `del` statement](http://docs.python.org/tutorial/datastructures.html#the-del-statement):

```
x = {'a': 5, 'b': 2, 'c': 3}
del x['a'], x['b']
print x
{'c': 3}

```
The general form I use is this:

1. Produce a list of keys to delete from the mapping;
2. Loop over the list and call [del](http://docs.python.org/tutorial/datastructures.html#the-del-statement) for each.

Example:

Say I want to delete all the string keys in a mapping. Produce a list of them:

```
>>> x={'a':5,'b':2,'c':3,1:'abc',2:'efg',3:'xyz'}
>>> [k for k in x if type(k) == str]
['a', 'c', 'b']

```

Now I can delete those:

```
>>> for key in [k for k in x if type(k) == str]: del x[key]
>>> x
{1: 'abc', 2: 'efg', 3: 'xyz'}

```