What's a more pythonic or efficent way of removing the last element of each list, in a dictionary of lists?
For example, take this:
listDict = {'tom': [-2,10,2,-8], 'sam': [-9,-10,-10,-7]}
And transform it into this:
listDict = {'tom': [-2,10,2], 'sam': [-9,-10,-10]}
This is what I'm currently doing:
new = {}
for t,item in listDict.iteritems():
new[t] = [item[0], item[1], item[2]]
listDict= new