So I have this dict
dic = { 0: [3,6,4], 1: [1,1,2], 2: [3,5,3], 3: [1,7,4], 4: [1,3,3], 5: [4,4,6] }
and I'd like to create another dictionary where the sum() of each list is > 10 using filter() and lambda expressions.
Outpout desired: { 0: [3,6,4], 2: [3,5,3], 3: [1,7,4], 5: [4,4,6] }
I tried something like
dict(filter(lambda e: sum(e[1]) > 10, dic.items()))
but it doesn't work at all
Edit:
Ok, I just solved.
dict(filter(lambda e: sum(e[1][::]) > 10, dic.items()))