You are viewing a single comment's thread. Return to all comments →
def simpleArraySum(ar): return sum(ar) n = int(input()) ar = list(map(int, input().split())) result = simpleArraySum(ar) print(result)
Seems like cookies are disabled on this browser, please enable them to open this website
Simple Array Sum
You are viewing a single comment's thread. Return to all comments →
For Python3 Platform
with python, you can use the sum function. But with other languages, you have to use the loop to calculate the sum