diff options
Diffstat (limited to 'challenge-251/luca-ferrari/python/ch-1.py')
| -rw-r--r-- | challenge-251/luca-ferrari/python/ch-1.py | 25 |
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: ] ) ) |
