I have the below code and I want to get the sum of each list in the nested listed parallelly using multi-processing or threading or any other method in Python 3.x. How do I approach this? All the sub lists or atleast 2 sub lists should run the addition function at the same time.
Thanks in advance!
nested_list = [[2,3,4], [4,5,6], [7,8,9], [10,11,12]]
def addition(list):
tot = sum(list)
return tot
for list in nested_list:
tot = addition(list)
print (tot)