aboutsummaryrefslogtreecommitdiff
path: root/challenge-238/luca-ferrari/python/ch-1.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-238/luca-ferrari/python/ch-1.py')
-rw-r--r--challenge-238/luca-ferrari/python/ch-1.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/challenge-238/luca-ferrari/python/ch-1.py b/challenge-238/luca-ferrari/python/ch-1.py
new file mode 100644
index 0000000000..67507eb558
--- /dev/null
+++ b/challenge-238/luca-ferrari/python/ch-1.py
@@ -0,0 +1,22 @@
+#!python
+
+import sys
+
+def main( argv ):
+ running_sum = []
+ current_index = 0
+ while current_index < len( argv ):
+ running_sum.insert( current_index, 0 )
+
+ for n in argv[ 0 : current_index ]:
+ running_sum[ current_index ] += int( n )
+
+ current_index += 1
+
+ print( ", ".join( map( str, running_sum ) ) )
+
+
+
+
+if __name__ == '__main__':
+ main( sys.argv[ 1: ] )