From 093553020c7cf39461a2be0e1c8851c983ba863b Mon Sep 17 00:00:00 2001 From: Luca Ferrari Date: Mon, 26 Feb 2024 09:28:02 +0100 Subject: PWC 258 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 Task 1 Java done Task 2 Java done --- challenge-258/luca-ferrari/python/ch-1.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 challenge-258/luca-ferrari/python/ch-1.py (limited to 'challenge-258/luca-ferrari/python/ch-1.py') diff --git a/challenge-258/luca-ferrari/python/ch-1.py b/challenge-258/luca-ferrari/python/ch-1.py new file mode 100644 index 0000000000..4ba789cf54 --- /dev/null +++ b/challenge-258/luca-ferrari/python/ch-1.py @@ -0,0 +1,25 @@ +#!python + +# +# Perl Weekly Challenge 258 +# Task 1 +# +# See +# + +import sys + +# task implementation +# the return value will be printed +def task_1( args ): + sum = 0 + for n in args: + if len( n ) % 2 == 0: + sum += 1 + + return sum + + +# invoke the main without the command itself +if __name__ == '__main__': + print( task_1( sys.argv[ 1: ] ) ) -- cgit