Skip to content

Commit

Permalink
Update and rename sumUp.py to sum_array.py
Browse files Browse the repository at this point in the history
Kalpak Take authored Aug 5, 2017
1 parent 8475844 commit 45522a7
Showing 2 changed files with 13 additions and 22 deletions.
22 changes: 0 additions & 22 deletions sumUp.py

This file was deleted.

13 changes: 13 additions & 0 deletions sum_array.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
def sum_arr(n):
res = 0
for x in n:
res += x
return res

nums = [52345,746587,98589,54398,9348,45887,49856]
test = sum_arr(nums)
if test == sum(nums):
print("Sum of arr: {}".format(test))
else:
print("Func dosen't work!")
# Most simple algorithm ever! Isn't it!

0 comments on commit 45522a7

Please sign in to comment.