'Adding elements in a 1 D vector [duplicate]

I am trying to add the elements that are in a row vector to a 1X1 vector in python, Problem: [10 100]

Solution: [110]

Is there any way to achieve this?



Solution 1:[1]

Example provided in question is more of a list.

To sum up all the elements in a list, sum() function can be used.

e.g: sum([10 100]) //output: 110

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ruakn