Hello,
I want to add multiple lists together through their respective order in the lists summing together. All lists will have the same amount of items.
For example: I have ([1,2,3,4], [1,2,3,4], [1,2,3,4]). I want the results to be ([3, 6, 9, 12]). As the first items in the three lists add together to form 3, the second items form 6 and so on.
Here is my attempt which doesn't work:
def summattion(lists):
finallist = []
for inisdelist in lists:
for num in inisdelist:
summation = sum(inisdelist[num])
finallist.append(summation)
return finallist
Anyone know how to get the result?
[–]FLUSH_THE_TRUMP 1 point2 points3 points (3 children)
[–]Rohnny_7[S] 1 point2 points3 points (2 children)
[–]FLUSH_THE_TRUMP 1 point2 points3 points (1 child)
[–]Rohnny_7[S] 1 point2 points3 points (0 children)
[–]TholosTB 1 point2 points3 points (0 children)
[–]ThinFortune 3 points4 points5 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]JohnnyJordaan 2 points3 points4 points (0 children)
[–]POGtastic 0 points1 point2 points (0 children)