Tuesday, December 26, 2006

Sum of elements of array @ Python

array = input('Enter the array')
sum = 0
for i in array:
sum = sum + i
print "sum of elements of array is", sum

No comments: