Write an algorithm for sum of n numbers and compute its time complexity
Answers
Answered by
1
Answer:
you can take arry from user and then do it....
Explanation:
arr = []
# input values to list
arr = [12, 3, 4, 15]
# sum() is an inbuilt function in python that adds
# all the elements in list,set and tuples and returns
# the value
ans = sum(arr)
# display sum
print ('Sum of the array is ',ans)
Similar questions