Is there an easier way to summarize items from a list than the code I wrote below? I am new to this and it seems a little cumbersome.
n = [3,5,7] o = [4,10,8] p = [4,10,5] lists = [n, o, p] def sumList(x): return sum(x) def listAdder(y): count = 0 for item in y: count += sumList(item) return count print listAdder(lists)
source share