Suppose your dictionary is called test_dict
.
This will give you desired result.
from functools import reduce
result = reduce(lambda x,y: x-y, [int(i[1]) for i in test_dict.values()])
solved How to subtract a value in the dictionary [closed]
Suppose your dictionary is called test_dict
.
This will give you desired result.
from functools import reduce
result = reduce(lambda x,y: x-y, [int(i[1]) for i in test_dict.values()])
solved How to subtract a value in the dictionary [closed]