I have a python dictionary, which looks like this.
{ \'item1\' : [1,2,3,4,5,6], \'item2\' : [2,3,1], . . . \'item n\' : [4,2,4,3,2] }
This seems unnecessarily complicated. If you have your input as
inpt = { 'item1' : [1,2,3,4,5,6], 'item2' : [2,3,1], . . . 'item n' : [4,2,4,3,2] }
you can then use a dictionary comprehension instead:
out = {k: [sum(inpt[k])] for k in inpt.keys()}