[Solved] How can i add the numbers of tuples from different lists of a a list in Python? [closed]
If the “list names” are always in the same order, you can do this using a list comprehension with zip and sum: >>> data = [[(‘Lista-A’, 1), (‘Lista-X’, 1), (‘Lista-Z’, 4)], [(‘Lista-A’, 2), (‘Lista-X’, 0), (‘Lista-Z’, 1)], [(‘Lista-A’, 5), (‘Lista-X’, 1), (‘Lista-Z’, 0)], [(‘Lista-A’, 0), (‘Lista-X’, 1), (‘Lista-Z’, 4)]] >>> [(col[0][0], sum(x for _, x … Read more