aboutsummaryrefslogtreecommitdiff
path: root/challenge-251/luca-ferrari/python/ch-1.py
diff options
context:
space:
mode:
authorLuca Ferrari <fluca1978@gmail.com>2024-01-08 10:17:22 +0100
committerLuca Ferrari <fluca1978@gmail.com>2024-01-08 11:12:16 +0100
commit080fde56fb9825f48e63c97840234fbde25fedaa (patch)
treed8ca72df8e07e7645657406b7638c113f3abc008 /challenge-251/luca-ferrari/python/ch-1.py
parent9a485c9bac8e3887b165d67c9aa81d71cdd42f01 (diff)
downloadperlweeklychallenge-club-080fde56fb9825f48e63c97840234fbde25fedaa.tar.gz
perlweeklychallenge-club-080fde56fb9825f48e63c97840234fbde25fedaa.tar.bz2
perlweeklychallenge-club-080fde56fb9825f48e63c97840234fbde25fedaa.zip
PWC 251
Task 1 Raku done Task 2 Raku done Task 1 PL/Perl done Task 2 PL/perl done Task 1 PL/PgSQL done Task 2 PL/PgSQL done Task 1 Python done Task 2 Python done
Diffstat (limited to 'challenge-251/luca-ferrari/python/ch-1.py')
-rw-r--r--challenge-251/luca-ferrari/python/ch-1.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/challenge-251/luca-ferrari/python/ch-1.py b/challenge-251/luca-ferrari/python/ch-1.py
new file mode 100644
index 0000000000..e72f979066
--- /dev/null
+++ b/challenge-251/luca-ferrari/python/ch-1.py
@@ -0,0 +1,25 @@
+#!python
+
+#
+# Perl Weekly Challenge 251
+# Task 1
+#
+# See <https://perlweeklychallenge.org/blog/perl-weekly-challenge-251/>
+#
+
+import sys
+
+# task implementation
+def main( argv ):
+ sum = 0
+ for i in range( 0, len( argv ) - 1 ):
+ if i % 2 != 0:
+ continue
+ sum += int( argv[ i ] + argv[ i + 1 ] )
+
+ return sum
+
+
+# invoke the main without the command itself
+if __name__ == '__main__':
+ print( main( sys.argv[ 1: ] ) )