python sum of list
>>> list = [1, 2, 3]
>>> sum(list)
6
python array sum
def simpleArraySum(ar):
x=0
for i in range(0,ar_count):
x = x + ar[i]
return x
addition of array in python with input
#Python program to add all the array elements using the built-in function
lst = []
num = int(input("Enter the size of the array: "))
print("Enter array elements: ")
for n in range(num):
numbers = int(input())
lst.append(numbers)
print("Sum:", sum(lst))
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us