Skip to content

Commit 3c77a83

Browse files
beaucarnesShMcK
authored andcommitted
1.1S Sum function
1 parent 03ca320 commit 3c77a83

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/example.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Solution
22
def add(*args):
33
'''Add 1 or more numbers together'''
4-
return 0
4+
total = 0
5+
for arg in args:
6+
total += arg
7+
return total
58

69
def main():
710
print('add(1) = ' + str(add(1)))

0 commit comments

Comments
 (0)