Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #!/bin/python3
  2.  
  3. import os
  4. import sys
  5.  
  6. #
  7. # Complete the simpleArraySum function below.
  8. #
  9. def simpleArraySum(ar):
  10.  
  11. # Write your code here.
  12. #
  13.  
  14. total = 0
  15. for x in ar:
  16. total = total + x
  17. return total
  18.  
  19.  
  20. if __name__ == '__main__':
  21. fptr = open(os.environ['OUTPUT_PATH'], 'w')
  22.  
  23. ar_count = int(input())
  24.  
  25. ar = list(map(int, input().rstrip().split()))
  26.  
  27. result = simpleArraySum(ar)
  28.  
  29. fptr.write(str(result) + '\n')
  30.  
  31. fptr.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement