Nov-15-2018, 04:13 PM
Can someone help me? I have a list = [[10,20], [30,40],[50,60]]
I have to generate the sum of the list elements p.e: (10+20), (30+40), (50+60). Then I have to add the new results into the list above.
Output should be: [[10,20,30], [30,40,70], [50,60,110]]
After that I have to convert the list into a tuple.
How can I solve this? Annotation: I´m a total beginner. I tried to use the sum() function - Didn´t work. Furthermore I have no idea how I could use a loop in this task.
Thank you in advance!
I have to generate the sum of the list elements p.e: (10+20), (30+40), (50+60). Then I have to add the new results into the list above.
Output should be: [[10,20,30], [30,40,70], [50,60,110]]
After that I have to convert the list into a tuple.
How can I solve this? Annotation: I´m a total beginner. I tried to use the sum() function - Didn´t work. Furthermore I have no idea how I could use a loop in this task.

Thank you in advance!