From 0cc3d19f45790123a25f7f33d9c5b3b239a48c5f Mon Sep 17 00:00:00 2001 From: Luca Ferrari Date: Wed, 14 Feb 2024 11:29:06 +0100 Subject: PWC 256 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 PL/Java done Task 2 PL/Java done --- challenge-256/luca-ferrari/python/ch-2.python | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 challenge-256/luca-ferrari/python/ch-2.python (limited to 'challenge-256/luca-ferrari/python/ch-2.python') diff --git a/challenge-256/luca-ferrari/python/ch-2.python b/challenge-256/luca-ferrari/python/ch-2.python new file mode 100644 index 0000000000..abf9af51de --- /dev/null +++ b/challenge-256/luca-ferrari/python/ch-2.python @@ -0,0 +1,32 @@ +#!python + +# +# Perl Weekly Challenge 256 +# Task 2 +# +# See +# + +import sys + +# task implementation +# the return value will be printed +def task_2( args ): + left = args[ 0 ] + right = args[ 1 ] + output = '' + + max_index = max( len( left ), len( right ) ) + + for i in range( 0, max_index ): + if i < len( left ): + output += left[ i ] + if i < len( right ): + output += right[ i ] + + return output + + +# invoke the main without the command itself +if __name__ == '__main__': + print( task_2( sys.argv[ 1: ] ) ) -- cgit