Skip to content

Instantly share code, notes, and snippets.

@nazmul629
Last active September 8, 2019 12:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nazmul629/7c253b39f223ad01336f73e1d1a69a18 to your computer and use it in GitHub Desktop.
Save nazmul629/7c253b39f223ad01336f73e1d1a69a18 to your computer and use it in GitHub Desktop.
Simple Array Sum

Given an array of integers,N can you find the sum of its elements?

Function Description

  • Complete the simpleArraySum function in the editor below. It must return the sum of the array elements as an integer. simpleArraySum has the following parameter(s):

Output Format

  • Print the sum of the array's elements as a single integer.

Sample Input

6 
1,2,3,4,10,11

Sample Input

31

n = int(input("Size of Array: "))
arr = [int(a) for a in input("Array Value: ").split(' ')]
print(sum(arr))

Hackerrank

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment