about | help | code help+videos | done | prefs |
Write a function called nested_sum that takes a list of lists of integers and adds up the elements from all of the nested lists. For example: >>> t = [[1, 2], [3], [4, 5, 6]] >>> nested_sum(t) 21 nested_sum([[1, 2], [3], [4, 5, 6]]) → 21 nested_sum([[1, 2, 3, 4, 5, 6]]) → 21 nested_sum([[1, 2]]) → 3 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 101 Post-solution available
Copyright Nick Parlante 2017 - privacy