Collapsing dict keys into one key: Python
<p>So I have a bunch of dictionaries in a list, whose keys are numbers and values are string objects. something like <code>[{0:'tom',1:'cat',2:'apache',3:'server',4:'open', 5:'now'},...]</code> and I like to get something like </p>

<p><code>[{0: 'tom cat apache', 1:'server',2:'open',3:'now'},...]</code> by collapsing the first 3 keys into 1 keys and adding their values. The keys may or may not be always consecutive or starting at zero.</p>

<p>I can do this with for loops and if statement, but my implementation seems messy. I'm sure there's a pythonic way. Thanks!</p>
