python-tutorialsmade

Python program to find the sum of array

Let’s write a simple python program to find the sum of an array.

It’s very simple to calculate the sum of an array in Python, you just have to use a python function called sum(). 

Here is the example snippet:

The output of the above program: 

So, just create an array arr = [10,20] of integers in python and pass the array variable to the sum(arr) function to calculate the sum of integers.

 

 

Related Posts

Leave a Reply