From 44a92ee6dd0ca577889cc1489e1237d5084a1efc Mon Sep 17 00:00:00 2001 From: Luca Ferrari Date: Thu, 4 Apr 2024 13:03:27 +0200 Subject: PWC 263 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 PL/Java done Task 2 PL/Java done Task 1 Python done Task 2 PYthon done --- challenge-263/luca-ferrari/python/ch-1.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 challenge-263/luca-ferrari/python/ch-1.py (limited to 'challenge-263/luca-ferrari/python/ch-1.py') diff --git a/challenge-263/luca-ferrari/python/ch-1.py b/challenge-263/luca-ferrari/python/ch-1.py new file mode 100644 index 0000000000..445b48b004 --- /dev/null +++ b/challenge-263/luca-ferrari/python/ch-1.py @@ -0,0 +1,23 @@ +#!python + +# +# Perl Weekly Challenge 263 +# Task 1 +# +# See +# + +import sys + +# task implementation +# the return value will be printed +def task_1( args ): + k = int( args[ 0 ] ) + nums = list( map( int, args[ 1: ] ) ) + nums.sort() + return list( filter( lambda x: nums[ x ] == k, range( 0, len( nums ) ) ) ) + + +# invoke the main without the command itself +if __name__ == '__main__': + print( task_1( sys.argv[ 1: ] ) ) -- cgit