Skip to content

Commit 4d45595

Browse files
committed
add summatory
1 parent 884c8f4 commit 4d45595

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: Summatory.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
def suma(slist): # SUMMATORY
2+
sum = 0
3+
for x in slist:
4+
if not (type(x) == int and type(x) == float):
5+
sum += x
6+
else:
7+
raise ValueError("Item in list wasn't a number")
8+
return sum

0 commit comments

Comments
 (0)