I've been working on a function that takes a two dimensional list of nums as a parameter and returns a list with the index of the row with the highest sum of values and the sum of those values. This is as far as i've gotten. I've tried accumulator, if [i]+1>i: but keep getting error message can only concanetate list not int. I've tried adding for j in newList: and too many nums print out.Can someone help me out. 1st year programmer and really stuck. When I use max error not iterable.
def FindLargestRow(lsts):
newList=[]
for i in lsts:
newList.append(sum(i))
return newList
print(FindLargestRow([[1,2,3],[1,2,3,4,5],[1,2],[1,2,3,4]]))
print()
desired result is:
Start FindLargestRow [1,15]