I have a list of dictionaries like this.
fruit = [{"apple": 10, "pear": 20, "banana": 30, "strawberry": 50},
{"apple": 12, "pear": 5, "banana": 20, "strawberry": 5},
{"apple": 15, "pear": 26, "banana": 32, "strawberry": 8}]
Can I write an reduce function in one line(with lambda argument) to get a new dictionary with the same keys. The value to each key of the new dictionary is the sum of all the values to the corresponding key. The expected output should be a dictionary as follows:
{'apple': 37.0, 'pear': 51.0, 'banana': 82.0, 'strawberry': 63.0}