Answer to Question #281915 in Python for bhargav

Question #281915

print the sum of an array and the array 1-d


1
Expert's answer
2021-12-22T01:10:32-0500
def _sum(array):

    sum = 0

    for i in array:
        sum = sum + i

    return (sum)

array = []
# in this line add you numbers
array = [123, 6, 13, 7]

n = len(array)
ans = _sum(array)

print('You number of array is', ans)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS