Python - Ways to sum list of lists and return sum list Last Updated : 11 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report When working with nested lists (lists of lists), we may need to compute the sum of corresponding elements across all inner lists. In this article, we will see how Python provides multiple methods to perform this task. The most common and efficient way to sum up a list of lists is by using zip() combined list comprehension. Python a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] b = [sum(x) for x in zip(*a)] print(b) Output[12, 15, 18] zip(*lists) unpacks the inner lists and groups their corresponding elements together: [(1, 4, 7), (2, 5, 8), (3, 6, 9)].sum(x) computes the sum of each tuple.The result is a list containing the sum of corresponding elements: [12, 15, 18].Let's explore some other methods and see different ways to sum list of lists and return sum list in Python.Table of ContentUsing map() and sum()Using NumPyUsing LoopsUsing map() and sum()map() function can be used to apply sum() to each group of corresponding elements. Python a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] b = list(map(sum, zip(*a))) print(b) Output[12, 15, 18] Explanation:zip(*lists) groups corresponding elements across all lists.map(sum, ...) applies the sum() function to each group.list() converts the result back to a list.Using NumPyIf we are working with large lists or require more advanced numerical operations, NumPy is a powerful library for such tasks. Python import numpy as np a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] b = np.sum(a, axis=0).tolist() print(b) Output[12, 15, 18] Explanation:np.sum() computes the sum along the specified axis.axis=0 sums across the rows (corresponding elements)..tolist() converts the result back to a Python list.Using LoopsFor a more manual approach, we can iterate through the lists using a for loop and sum the corresponding elements. Python a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] # Initialize a result list with zeros b = [0] * len(a[0]) # Add elements from each list for l in a: for i in range(len(l)): b[i] += l[i] print(b) Output[12, 15, 18] Explanation:A result list sum_list is initialized with zeros.A nested loop iterates through each list and its elements, adding corresponding values. Comment More infoAdvertise with us Next Article Python Program to Find the Total Sum of a Nested List Using Recursion G garg_ak0109 Follow Improve Article Tags : Python Python Programs python-list Python list-programs Practice Tags : pythonpython-list Similar Reads Python Program to Find the Total Sum of a Nested List Using Recursion A nested list is given. The task is to print the sum of this list using recursion. A nested list is a list whose elements can also be a list. Examples : Input: [1,2,[3]] Output: 6 Input: [[4,5],[7,8,[20]],100] Output: 144 Input: [[1,2,3],[4,[5,6]],7] Output: 28 Recursion: In recursion, a function ca 5 min read Python - Summation of float string list Sometimes, while working with Python list, we can have a problem in which we need to find summation in list. But sometimes, we donât have a natural number but a floating-point number in string format. This problem can occur while working with data, both in web development and Data Science domain. Le 7 min read Python - List of dictionaries all values Summation Given a list of dictionaries, extract all the values summation. Input : test_list = [{"Apple" : 2, "Mango" : 2, "Grapes" : 2}, {"Apple" : 2, "Mango" : 2, "Grapes" : 2}] Output : 12 Explanation : 2 + 2 +...(6-times) = 12, sum of all values. Input : test_list = [{"Apple" : 3, "Mango" : 2, "Grapes" : 2 5 min read Python | Summation of dictionary list values Sometimes, while working with Python dictionaries, we can have its values as lists. In this can, we can have a problem in that we just require the count of elements in those lists as a whole. This can be a problem in Data Science in which we need to get total records in observations. Let's discuss c 6 min read Python - Get summation of numbers in string list Sometimes, while working with data, we can have a problem in which we receive series of lists with data in string format, which we wish to accumulate as list. Let's discuss certain ways in which this task can be performed. Method #1 : Using loop + int() This is the brute force method to perform this 3 min read Python - Sum of different length Lists of list Getting the sum of list is quite common problem and has been dealt with and discussed many times, but sometimes, we require to better it and total sum, i.e. including those of nested list as well. Letâs try and get the total sum and solve this particular problem. Method #1 : Using list comprehension 5 min read Like